如何在 AlmaLinux 8 上安装 Neos CMS

Neos CMS 是一个免费的开源内容管理系统 (CMS)。Neos 提供了一组丰富的功能,例如内联编辑、一次安装支持多个网站、内置 SEO 工具、人类可读的 URL、插件管理器、设备预览,并支持多个模板。Neos-CMS-logo

在 AlmaLinux 8 上安装 Neos CMS

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

sudo dnf update
sudo dnf install epel-release

步骤 2. 安装 LAMP 服务器。

需要 AlmaLinux LAMP 服务器。如果您没有安装 LAMP,您可以在此处按照我们的指南进行操作。

步骤 3. 安装 Composer。

在安装 Neos 之前,您需要将 Composer 安装到您的系统中:

curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

验证 Composer 安装:

composer --version

步骤 4. 在 AlmaLinux 8 上安装 Neos CMS。

默认情况下,Neos CMS 在 AlmaLinux 8 基础存储库中不可用。现在我们使用 Composer 安装 Neos 及其依赖项:

sudo mkdir -p /var/www/neos
sudo chown -R $USER:$USER /var/www/neos
cd /var/www/neos
composer create-project --no-dev neos/neos-base-distribution

我们将需要更改一些文件夹权限:

chown -R www-data:www-data /var/www/neos
chmod -R 755 /var/www/html/neos/

步骤 5. 为 Neos CMS 配置 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 控制台并为 Neos 创建一个数据库。运行以下命令:

mysql -u root -p

这将提示您输入密码,因此请输入您的 MariaDB 根密码并按 Enter。登录到数据库服务器后,您需要为 Neos 安装创建一个数据库:

MariaDB [(none)]> CREATE DATABASE neos_db;
MariaDB [(none)]> CREATE USER 'neos'@'localhost' IDENTIFIED BY 'your-strong-password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neos_db.* TO 'neos'@'localhost' IDENTIFIED BY 'your-strong-password' WITH GRANT OPTION;
MariaDB [(none)]> ALTER DATABASE neos_db charset=utf8;
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

步骤 6. 配置 Apache。

我们将为您的 phpBB 网站创建一个 Apache 虚拟主机。首先,使用您选择的文本编辑器创建 ‘ ‘ 文件:/etc/apache/conf.d/vhosts.conf

nano /etc/apache/conf.d/vhosts.conf
IncludeOptional vhosts.d/*.conf

接下来,创建虚拟主机:

mkdir /etc/apache/vhosts.d/
nano /etc/apache/vhosts.d/your-domain.com.conf

添加以下行:

<VirtualHost YOUR_SERVER_IP:80>
   ServerAdmin webmaster@your-domain.com
   DocumentRoot "/var/www/neos/Web/"
   ServerName your-domain.com
   ServerAlias www.your-domain.com
   ErrorLog "/var/log/httpd/your-domain.com-error_log"
   CustomLog "/var/log/httpd/your-domain.com-access_log" combined

<Directory "/var/www/neos/Web/">
   DirectoryIndex index.html index.php
   Options FollowSymLinks
   AllowOverride All
   Require all granted
</Directory>
</VirtualHost>

保存并关闭文件。重新启动 Apache 服务以使更改生效:

sudo systemctl restart httpd
sudo systemctl enable httpd

步骤 7. 使用 Let’s Encrypt SSL 免费证书保护 Apache

首先,我们使用以下命令安装 Certbot:

sudo dnf install certbot python3-certbot-apache

然后,为 Apache 安装 SSL 证书,如下所示:

sudo certbot --apache

进入交互式提示并安装证书。如果安装了证书,您将看到以下祝贺消息:

Deploying certificate
Successfully deployed certificate for osticket.example.com to /etc/httpd/conf.d/osticket-le-ssl.confCongratulations! You have successfully enabled HTTPS on https://your-domain.com
NEXT STEPS:
- The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https://certbot.org/renewal-setup for instructions.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

步骤 8. 配置防火墙。

允许防火墙使用 HTTP 和 HTTPS 并使用以下命令重新加载它:

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

步骤 9. 访问 Neos CMS Web 界面。

成功安装后,打开您的 Web 浏览器并使用 URL 访问 Neos CMS 。您将被重定向到以下页面:https://your-domain.com

install-neos-cms

然后,在终端中运行以下命令以获取您的密码:

cat /var/www/neos/Data/SetupPassword.txt

感谢您使用本教程在您的 AlmaLinux 8 系统上安装 Neos CMS(内容管理系统)。如需更多帮助或有用信息,我们建议您查看Neos CMS 官方网站

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

相关文章