如何在 AlmaLinux 8 上安装 Etherpad

EtherPad 是一个基于 Web 的实时协作文本编辑器,可以让几个人方便地在线协作处理文档. 它是用 Node.js 编写的,可以自托管以使用各种平台,如 WordPress、Drupal、Odoo、Joomla 等。Etherpad-logo

在 AlmaLinux 8 上安装 Etherpad

步骤 1. 首先,让我们先确保您的系统是最新的。

sudo dnf update
sudo dnf install epel-release

步骤 2. 在 AlmaLinux 8 上安装 Git。

Git在 Almalinux 的默认存储库中可用。现在运行以下命令来安装它:

sudo dnf install git

执行以下命令确认安装并检查版本:

git --version

接下来,添加初始配置:

git config --global user.name "YourName"
git config --global user.email "name@your-domain.com"

步骤 3. 在 AlmaLinux 8 上安装 MariaDB。

MariaDB是一种流行的数据库服务器。现在我们使用以下命令安装 MariaDB 数据库服务器:

sudo dnf install mariadb-server mariadb

安装完成后,开始使用以下命令使其在系统启动时启动:

sudo systemctl restart mariadb
sudo systemctl status mariadb
sudo systemctl enable mariadb

默认情况下,MariaDB 未加固。您可以使用mysql_secure_installation脚本保护 MariaDB 。您应该仔细阅读以下每个步骤,这些步骤将设置 root 密码、删除匿名用户、禁止远程 root 登录以及删除测试数据库和访问安全 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,请使用以下命令(请注意,它与您用于登录 MariaDB 数据库的命令相同):

mysql -u root -p

现在我们为 Etherpad 创建一个新数据库:

create database `etherpad_db`;
CREATE USER 'etherpaduser'@'localhost' identified by 'your-strong-password';
grant CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE on `etherpad_db`.* to '<etherpaduser>'@'localhost';
exit

步骤 4. 在 AlmaLinux 8 上安装 Etherpad。

首先,我们使用以下命令创建一个新的 Etherpad 用户:

sudo adduser --system --home /opt/etherpad --create-home --user-group etherpad

接下来,我们将把二进制文件克隆到一个目录中:/opt/etherpad

cd /opt/etherpad
git clone --branch master git://github.com/ether/etherpad-lite.git
cd etherpad-lite

最后,运行安装脚本:

src/bin/run.sh

步骤 5. 配置 Etherpad。

Etherpad将其设置保存在安装目录下的文件中,我们需要进行一些设置和配置:settings.json

nano settings.json

找到下面的代码,放在//前面注释掉:

//  "dbType": "dirty",
//  "dbSettings": {
//    "filename": "var/dirty.db"
//  },

接下来,找到以下代码并将其值更改如下。确保在开头和结尾删除/**/

"dbType" : "mysql",
  "dbSettings" : {
  "user":     "etherpaduser",
  "host":     "localhost",
  "port":     3306,
  "password": "your-strong-password",
  "database": "etherpad_db",
  "charset":  "utf8mb4"
  },

之后,向下滚动一点以找到trustProxy设置并将其值从 更改falsetrue

"trustProxy": true,

步骤 6. 创建 Etherpad 服务。

现在我们创建一个 Etherpadsystemd服务文件:

sudo nano /etc/systemd/system/etherpad.service

添加以下行:

[Unit]
Description=Etherpad, a collaborative web editor.
After=syslog.target network.target

[Service]
Type=simple
User=etherpad
Group=etherpad
WorkingDirectory=/opt/etherpad
Environment=NODE_ENV=production
ExecStart=/usr/bin/node --experimental-worker /opt/etherpad/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js
Restart=always

[Install]
WantedBy=multi-user.target

保存并关闭文件,然后启动 Etherpad 服务:

sudo systemctl daemon-reload
sudo systemctl enable etherpad --now

步骤 7. 配置防火墙

不要忘记在防火墙中允许端口:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=9001/tcp

步骤 8. 访问 Etherpad Web 界面。

成功安装后,打开您喜欢的浏览器并导航到. 您将看到以下屏幕:http://your-ip-address:9001

etherpad-web-interface

感谢您使用本教程在您的 AlmaLinux 8 系统上安装基于 Etherpad 网络的在线协作文档编辑器。如需更多帮助或有用信息,我们建议您查看Etherpad 官方网站

未经允许不得转载:统信UOS之家 » 如何在 AlmaLinux 8 上安装 Etherpad

相关文章