GNU/Linux >> Linux の 問題 >  >> Cent OS

CentOS7VPSにEtherpadをインストールします

このチュートリアルでは、CentOS7VPSにEtherpadをインストールする方法を説明します。 Etherpadは、共同リアルタイム編集を提供するオープンソースのオンラインエディターです。このガイドは他のLinuxVPSシステムでも機能するはずですが、CentOS7VPS用にテストおよび作成されています。

SSH経由でVPSにログイン

ssh user@vps

システムを更新し、必要なパッケージをインストールします

[user]$ sudo yum -y upgrade
[user]$ sudo yum install curl vim gcc-c++ make

MariaDBのインストール

MariaDB5.5はデフォルトのCentOS7リポジトリに同梱されており、インストールするには次のコマンドを実行するだけです。

[user]$ sudo yum install mariadb-server

MariaDBサービスを開始し、起動時に開始できるようにするには、次のコマンドを実行します。

[user]$ sudo systemctl start mariadb.service
[user]$ sudo systemctl enable mariadb.service

次のコマンドを実行して、インストールを保護します。

[user]$ sudo mysql_secure_installation

次に、Etherpadインスタンスのデータベースを作成する必要があります。

[user]$ mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE etherpad;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON etherpad.* TO 'etherpaduser'@'localhost' IDENTIFIED BY 'etherpaduser_passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

最新のNode.jsをインストールします

[user]$ curl -sL https://rpm.nodesource.com/setup | sudo bash -
[user]$ sudo yum install -y nodejs

すべてが正しく行われたことを確認するには、コマンドnode --versionを使用します 。
出力は次のようになります。

[user]$ node --version
v0.10.38

Etherpadユーザーの作成

Etherpadインスタンスの新しいシステムユーザーを作成するには、次のコマンドを実行します。

[user]$ sudo adduser --home /opt/etherpad --shell /bin/bash etherpad
[user]$ sudo install -d -m 755 -o etherpad -g etherpad /opt/etherpad

Etherpadのインストール

次のコマンドはetherpadユーザーとして実行されます。 etherpadユーザー実行に切り替えるには:

[user]$ sudo su - etherpad

Etherpadソースコードを/opt/etherpad/etherpad-liteに複製します ディレクトリ。

[etherpad]$ git clone git://github.com/ether/etherpad-lite.git ~/etherpad-lite

デフォルト設定構成ファイルをコピーします:

[user]$ cp ~/etherpad-lite/settings.json.template ~/etherpad-lite/settings.json

および変更/追加:

  • "ip": "0.0.0.0" to "ip": "127.0.0.1"
  • 「ダーティ」セクションにコメントする
  • MySQL構成を追加します
        "dbType" : "mysql",
        "dbSettings" : {
                        "user"    : "etherpaduser",
                        "host"    : "localhost",
                        "password": "etherpaduser_passwd",
                        "database": "etherpad"
                      },
    
    
  • "trustProxy" : false "trustProxy" : true
  • 管理者ユーザーを追加
          "users": {
             "admin": {
             "password": "__yourAdminPassword__",
             "is_admin": true
             }
            },
    

次のコマンドを実行して、依存関係をインストールします。

~/etherpad-lite/bin/installDeps.sh

初めてEtherpadを起動します:

~/etherpad-lite/bin/run.sh

エラーがない場合は、次の手順に進むことができます。

systemdサービスを作成する

Etherpad用の新しいsystemdサービスを作成するには、rootまたはsudoユーザーとして選択したエディターを開き、新しいファイルを作成します。

[user]$ sudo vim /etc/systemd/system/etherpad.service

次のコード行を追加します:

[Unit]
Description=Etherpad
After=syslog.target network.target

[Service]
Type=simple
User=etherpad
Group=etherpad
ExecStart=/opt/etherpad/etherpad-lite/bin/run.sh
Restart=always

[Install]
WantedBy=multi-user.target

Etherpadサービスを開始し、起動時に自動的に開始するように設定します:

[user]$ sudo systemctl enable etherpad.service
[user]$ sudo systemctl start etherpad.service

ユニットが起動したことを確認するには、journalctl -f -u etherpad.serviceを実行します。 以下のようなものが表示されます:

[user]$ journalctl -f -u etherpad.service
May 09 11:02:08 vps systemd[1]: Starting etherpad.service...
May 09 11:02:08 vps systemd[1]: Started etherpad.service.
May 09 11:02:08 vps run.sh[23118]: Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.

Nginxをインストールして構成する

Nginxのインストールは非常に簡単です。次のコマンドを実行するだけです:

[user]$ sudo apt-get install nginx

次に、新しいNginxサーバーブロックを作成します:

[user]$ sudo vim /etc/nginx/sites-available/myPad.com.conf
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
  server_name myPad.com;

  location / {
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header  Host $host;
    proxy_redirect off;
    proxy_read_timeout 300;
    proxy_pass http://localhost:9001/;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
  }
}

Nginxを再起動してサーバーブロックをアクティブ化します:

[user]$ sudo systemctl restart nginx

今後、Etherpadを最新バージョンに更新する場合は、/opt/etherpad/etherpad-lite && git pull originを実行するだけです。 systemctl restart etherpadを使用してEtherpadサービスを再起動します 。

それでおしまい。 CentosVPSにEtherpadが正常にインストールされました。 Etherpadの詳細については、EtherpadのWebサイトを参照してください。

もちろん、Linux VPSホスティングサービスのいずれかを使用している場合は、これを行う必要はありません。その場合は、専門のLinux管理者にセットアップを依頼するだけです。 24時間年中無休でご利用いただけます。リクエストはすぐに処理されます。

PS 。この投稿が気に入った場合は、左側のボタンを使用してソーシャルネットワーク上の友達と共有するか、下に返信を残してください。ありがとう。


Cent OS
  1. CentOS6VPSへのRedmineのインストール

  2. CentOSLinuxVPSにCouchDBをインストールします

  3. CentOS7VPSにPHP-Fusion7をインストールします

  1. CentOS6VPSにphpBB3をインストールする方法

  2. CentOSVPSにMongoDBをインストールします

  3. CentOSVPSにGibbonをインストールする方法

  1. CentOSVPSにDotclearをインストールします

  2. CentOS6VPSにGlassFishをインストールします

  3. CentOS6VPSにOctopressをインストールします