如何在 AlmaLinux 8 上安装 Etherpad
admin
2023-07-31 03:13:54
0

EtherPad 是一个基于 Web 的实时协作文本编辑器,可以让几个人方便地在线协作处理文档. 它是用 Node.js 编写的,可以自托管以使用各种平台,如 WordPress、Drupal、Odoo、Joomla 等。Etherpad-logoEtherpad-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 \'\'@\'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-interfaceetherpad-web-interface

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

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
在 Windows 11 中打... 什么是链路状态电源管理? 您可以在系统控制面板的电源选项中看到链接状态电源管理。它是 PCI Exp...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
iPhone 屏幕上有亮绿色斑... iPhone 是市场上最稳定的智能手机之一,这主要归功于专为它们设计的 iOS 操作系统。然而,他们...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
balenaEtcher烧录后... balenaEtcher烧录后u盘或者内存卡无法识别不能使用的解决方法想要恢复原来的方法,使用win...
统信UOS每次开机后不直接进入... 统信UOS每次开机后不直接进入系统而是进入到recovery模式 按方向上键选择UOS 20 SP1...