如何在 CentOS 8 上安装 WebERP

在本教程中,我们将向您展示如何在 CentOS 8 上安装 WebERP。对于那些不知道的人,webERP 是一个免费、开源且完整的基于 Web 的会计和业务管理系统。 您只需要一个网络浏览器和 PDF 阅读器即可使用 webERP。 使用 webERP,您可以管理许多事情,包括采购订单、网上商店、制造、销售、总帐和运输。 它是用 PHP 编写的,并使用 MariaDB 作为数据库后端。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将站点托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户中运行,否则您可能需要添加 ‘sudo‘ 到获得 root 权限的命令。 我将向您展示在 CentOS 8 上逐步安装 WebERP。

在 CentOS 8 上安装 WebERP

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

sudo dnf update sudo dnf install epel-release

步骤 2. 安装 LAMP 堆栈。

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

步骤 3. 在 CentOS 8 上安装 WebERP。

现在我们从官方页面下载WebERP软件包:

https://sourceforge.net/projects/web-erp/files/webERP_4.15.1.zip

之后,将下载的文件解压到 Apache 网页根目录:

unzip webERP_4.15.1.zip -d /var/www/html

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

chown -R apache:apache /var/www/html/webERP chmod -R 755 /var/www/html/webERP

步骤 4. 为 WebERP 配置 MariaDB。

默认情况下,MariaDB 未加固。 您可以使用以下方法保护 MariaDB mysql_secure_installation 脚本。 您应该仔细阅读以下每个步骤,这些步骤将设置 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 控制台并为 WebERP 创建一个数据库。 运行以下命令:

mysql -u root -p

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

MariaDB [(none)]> create database weberpdb; MariaDB [(none)]> create user [email protected] identified by '[email protected]@-passwd'; MariaDB [(none)]> grant all privileges on weberpdb.* to [email protected] identified by '[email protected]@-passwd'; MariaDB [(none)]> flush privileges; MariaDB [(none)]> exit;

步骤 5. 配置 Apache 对于 WebERP。

现在我们创建一个新的 Apache 用于托管 webERP 的虚拟主机配置文件。 您可以使用以下命令创建它:

nano /etc/httpd/conf.d/weberp.conf

添加以下行:

<VirtualHost *:80>  ServerAdmin [email protected] DocumentRoot /var/www/html/webERP ServerName your-domain.com <Directory /var/www/html/webERP/>  Options FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory>  ErrorLog /var/log/httpd/weberp.org-error_log CustomLog /var/log/httpd/weberp.org-access_log common </VirtualHost>

现在,我们可以重新启动 Apache 网络服务器,以便进行更改:

sudo systemctl restart httpd

步骤 6. 配置防火墙。

我们需要允许端口 80 和 443 通过防火墙。 您可以使用以下命令允许它们:

sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --reload

步骤 7. 访问 WebERP Web 界面。

默认情况下,WebERP 将在 HTTP 端口 80 上可用。 打开您最喜欢的浏览器并导航到 https://your-domain.com并完成所需的步骤以完成安装。 如果您使用防火墙,请打开端口 80 以启用对控制面板的访问。

恭喜! 您已成功安装 WebERP。 感谢您使用本教程在 CentOS 8 系统上安装 WebERP。 如需更多帮助或有用信息,我们建议您查看 官方WebERP网站.