このチュートリアルでは、Debian 11にEtherpadをインストールする方法を紹介します。知らない人のために、EtherpadはNode.jsで記述されており、何千もの同時実数をサポートしています。時間のユーザー。Etherpadは、さまざまなプラグインをサポートする高度にカスタマイズ可能なエディターです。また、doc、pdfなどの最新のドキュメント形式もサポートしています。
この記事は、少なくともLinuxの基本的な知識があり、シェルの使用方法を知っていること、そして最も重要なこととして、サイトを独自のVPSでホストしていることを前提としています。インストールは非常に簡単で、ルートアカウントで実行されていますが、そうでない場合は、'sudoを追加する必要があります。 ルート権限を取得するコマンドに‘。 Debian 11(Bullseye)にEtherpadを段階的にインストールする方法を紹介します。
前提条件
- 次のオペレーティングシステムのいずれかを実行しているサーバー:Debian10またはDebian11。
- 潜在的な問題を防ぐために、OSの新規インストールを使用することをお勧めします
non-root sudo userまたはroot userへのアクセス 。non-root sudo userとして行動することをお勧めします ただし、ルートとして機能するときに注意しないと、システムに害を及ぼす可能性があるためです。
Debian11BullseyeにEtherpadをインストール
ステップ1.ソフトウェアをインストールする前に、次のaptを実行して、システムが最新であることを確認することが重要です。 ターミナルのコマンド:
sudo apt update sudo apt upgrade sudo apt install gzip git curl python libssl-dev pkg-config gcc g++ make build-essential
ステップ2.Node.jsをインストールします。
EtherpadはNode.jsで記述されているため、サーバーにインストールする必要があります:
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
次に、以下のコマンドを実行して、NodesourceリポジトリからNode.js16.xをインストールします。
sudo apt install nodejs
Node.jsのバージョンを確認します:
node --version
ステップ3.MariaDBをインストールします。
次のコマンドを実行して、サーバーにMariaDBをインストールします。
sudo apt install mariadb-server
デフォルトでは、MariaDBは強化されていません。mysql_secure_installationを使用してMariaDBを保護できます。 脚本。ルートパスワードの設定、匿名ユーザーの削除、リモートルートログインの禁止、テストデータベースの削除と安全なMariaDBへのアクセスを行う各手順を注意深くお読みください。
mysql_secure_installation
次のように構成します:
- Set root password? [Y/n] y - Remove anonymous users? [Y/n] y - Disallow root login remotely? [Y/n] y - Remove test database and access to it? [Y/n] y - Reload privilege tables now? [Y/n] y
次に、MariaDBコンソールにログインして、Etherpad用のデータベースを作成する必要があります。次のコマンドを実行します。
mysql -u root -p
これによりパスワードの入力を求められるので、MariaDBルートパスワードを入力してEnterキーを押します。データベースサーバーにログインしたら、データベースを作成する必要があります。 Etherpadインストールの場合:
MariaDB [(none)]> CREATE DATABASE etherpad_db; MariaDB [(none)]> CREATE USER 'etherpad_user'@'localhost' IDENTIFIED BY 'your-strong-password'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON etherpad_db.* to etherpad_user@'localhost'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit
ステップ4.Debian11にEtherpadをインストールします。
デフォルトでは、EtherpadはDebian 11ベースリポジトリでは利用できません。そのため、公式ページから最新の安定バージョンのEtherpadをダウンロードします:
sudo adduser --system --no-create-home --home=/opt/etherpad-lite --group etherpad git clone --branch master https://github.com/ether/etherpad-lite.git
いくつかのフォルダの権限を変更する必要があります:
sudo chown -R etherpad:etherpad etherpad-lite
次に、ディレクトリ「etherpad-lite/」に移動します ‘そしてインストーラスクリプト‘ installDeps.shを使用してすべてのNode.js依存関係をインストールします ‘ :
cd /opt/etherpad-lite sudo su -s /bin/bash -c "./bin/installDeps.sh" etherpad
ステップ5.Etherpadを構成します。
次に、settings.jsonを編集します ファイルを作成し、データベース設定を定義します:
nano settings.json
次の行をコメントアウトします:
/*
*"dbType": "dirty",
*"dbSettings": {
* "filename": "var/dirty.db"
*},
*/ 次の行を変更します:
"dbType" : "mysql",
"dbSettings" : {
"user": "etherpad_user",
"host": "localhost",
"port": 3306,
"password": "your-strong-password",
"database": "etherpad_db",
"charset": "utf8mb4"
}, ステップ6.Etherpad用のSystemdサービスファイルを作成します。
次に、systemdを作成します Etherpadサービスを管理するためのサービスファイル:
sudo nano /etc/systemd/system/etherpad.service
次のファイルを追加します:
[Unit] Description=Etherpad-lite, the collaborative editor. After=syslog.target network.target [Service] Type=simple User=etherpad Group=etherpad WorkingDirectory=/opt/etherpad-lite Environment=NODE_ENV=production ExecStart=/usr/bin/node --experimental-worker /opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js # use mysql plus a complete settings.json to avoid Service hold-off time over, scheduling restart. Restart=always [Install] WantedBy=multi-user.target
ファイルを保存して閉じてから、systemdをリロードします 新しいサービスファイルを適用するマネージャー:
sudo systemctl daemon-reload sudo systemctl enable --now etherpad sudo systemctl status etherpad
ステップ7.Etherpad用にNginxリバースプロキシを構成します。
まず、以下のコマンドを使用してNginxをインストールします:
sudo apt install nginx
Nginxをインストールしたら、次のコマンドを使用してNginxサービスを開始して有効にします。
sudo systemctl start nginx sudo systemctl enable nginx
次に、Nginx仮想ホスト構成ファイルを作成します:
sudo nano /etc/nginx/sites-available/etherpad
次のファイルを追加します:
# enforce HTTPS
server {
listen 80;
listen [::]:80;
server_name etherpad.example.io;
return 301 https://$host$request_uri;
}
# we're in the http context here
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name etherpad.your-domain.com;
access_log /var/log/nginx/eplite.access.log;
error_log /var/log/nginx/eplite.error.log;
ssl_certificate /etc/letsencrypt/live/etherpad.example.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/etherpad.example.io/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 \
EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 \
EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
location / {
proxy_pass http://127.0.0.1:9001;
proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf
proxy_set_header Host $host;
proxy_pass_header Server;
# Note you might want to pass these headers etc too.
proxy_set_header X-Real-IP $remote_addr; # https://nginx.org/en/docs/http/ngx_http_proxy_module.html
proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP
proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used
proxy_http_version 1.1; # recommended with keepalive connections
# WebSocket proxying - from https://nginx.org/en/docs/http/websocket.html
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
} ファイルを保存して閉じてから、仮想ホスト構成をアクティブ化します:
sudo ln -s /etc/nginx/sites-available/etherpad /etc/nginx/sites-enabled/ nginx -t sudo systemctl restart nginx
手順8.ファイアウォールを構成します。
デフォルトでは、UFWファイアウォールはDebianで有効になっています。Apache仮想ホスト構成ファイルに応じて、ポート80と443を開いてHTTPおよびHTTPSトラフィックを許可します。
sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw reload
ステップ9.EtherpadWebインターフェイスへのアクセス。
正常にインストールされたら、Webブラウザーを開き、URL https://etherpad.your-domain.comを使用してMatomoにアクセスします。 。 Matomoインターフェースページにリダイレクトされます:
おめでとうございます!Etherpadが正常にインストールされました。このチュートリアルを使用してDebian 11 Bullseyeに最新バージョンのEtherpadをインストールしていただき、ありがとうございます。追加のヘルプや役立つ情報については、公式のEtherpadを確認することをお勧めします。ウェブサイト。