如何在CentOS 8上安装WebERP

如何在CentOS 8上安装WebERP

webERP是一个免费的,开放源代码的,基于Web的完整会计和业务管理系统。 要使用webERP,您需要一个Web浏览器和一个PDF阅读器。 借助webERP,您可以管理采购订单,网上商店,制造,销售,总分类帐,运输等。它是用PHP编写的,并使用MariaDB作为数据库后端。本教程将向您展示如何使用Apache和Let’s Encrypt SSL在CentOS 8上安装webERP。

先决条件

  • 运行CentOS的服务器8。
  • 指向服务器IP的有效域名。
  • 超级用户密码由服务器组成。

安装LAMP服务器

首先,使用以下命令安装Apache,MariaDB,PHP和其他PHP扩展:

dnf install httpd mariadb-server php php-mysqli php-curl php-json php-cgi php-xmlrpc php-gd php-mbstring unzip -y

一旦安装了所有软件包,请启动Apache和MariaDB服务,以便您可以使用以下命令在系统重新引导时启动软件包:

systemctl start httpd mariadbsystemctl enable httpd mariadb

完成后,您可以继续下一步。

配置MariaDB

接下来,您需要设置MariaDB根密码来保护您的MariaDB安装。您可以使用以下命令运行它:

mysql_secure_installation

回答所有问题,如下所示。

Enter current password for root (enter for none): 
Set root password? [Y/n] Y
New password: 
Re-enter new password: 
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

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

然后使用以下命令登录到MariaDB shell:

mysql -u root -p

连接后,使用以下命令创建webERP数据库和用户。

MariaDB [(none)]> create database weberp;MariaDB [(none)]> create user [email protected] identified by 'password';

然后使用以下命令将所有权限授予webERP数据库:

MariaDB [(none)]> grant all privileges on weberp.* to [email protected] identified by 'password';

然后刷新特权并使用以下命令退出MariaDB:

MariaDB [(none)]> flush privileges;MariaDB [(none)]> exit;

完成后,您可以继续下一步。

安装webERP

首先,使用以下命令下载最新版本的webERP:

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

下载完成后,使用以下命令将下载的文件解压缩到Apache Web根目录。

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

然后使用以下命令设置适当的权限和所有权。

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

完成后,您可以继续下一步。

为WebERP配置Apache

接下来,您需要创建一个新的Apache虚拟主机配置文件来承载webERP。可以使用以下命令创建它:

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

添加以下行。

<VirtualHost *:80> 
ServerAdmin [email protected]
DocumentRoot /var/www/html/webERP
ServerName weberp.example.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服务以应用更改。

systemctl restart httpd

现在,使用以下命令检查Apache的状态:

systemctl status httpd

您应该获得以下输出:Advertisement

? httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           ??php-fpm.conf
   Active: active (running) since Sat 2021-05-01 05:57:27 EDT; 13s ago
     Docs: man:httpd.service(8)
 Main PID: 4896 (httpd)
   Status: "Running, listening on: port 80"
    Tasks: 213 (limit: 25014)
   Memory: 24.8M
   CGroup: /system.slice/httpd.service
           ??4896 /usr/sbin/httpd -DFOREGROUND
           ??4898 /usr/sbin/httpd -DFOREGROUND
           ??4899 /usr/sbin/httpd -DFOREGROUND
           ??4900 /usr/sbin/httpd -DFOREGROUND
           ??4901 /usr/sbin/httpd -DFOREGROUND

May 01 05:57:27 centos8 systemd[1]: Stopped The Apache HTTP Server.
May 01 05:57:27 centos8 systemd[1]: Starting The Apache HTTP Server...

此时,Apache Web服务器已配置为托管webERP。现在,您可以继续下一步。

让我们加密SSL保护Web ERP

接下来,您需要安装Certbot客户端并安装“让我们为Web ERP加密SSL”。您可以使用以下命令进行安装。

dnf install letsencrypt python3-certbot-apache

然后,使用以下命令获取并安装您域的SSL证书。

certbot --apache -d weberp.example.com

系统将要求您输入电子邮件地址并同意使用条款。

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for weberp.example.com
Performing the following challenges:
http-01 challenge for weberp.example.com
Waiting for verification.
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/httpd/conf.d/weberp.conf
Redirecting all traffic on port 80 to ssl in /etc/httpd/conf.d/weberp.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://weberp.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subscribe to the EFF mailing list (email: [email protected]).


IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/weberp.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/weberp.example.com/privkey.pem
   Your certificate will expire on 2021-06-09. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again with the "certonly" option. To non-interactively
   renew *all* of your certificates, run "certbot renew"
 - 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

您现在可以使用URL安全地访问您的网站。 https://weberp.example.com..

配置防火墙

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

firewall-cmd --permanent --add-service=httpfirewall-cmd --permanent --add-service=https

然后重新加载防火墙以应用您的更改。

firewall-cmd --reload

访问webERP Web界面

然后打开Web浏览器并使用URL访问webERP Web界面。 https://weberp.example.com..显示下一页。

选择一种语言, 下一步..显示下一页。

如何在CentOS 8上安装WebERP

输入数据库名称,用户名和密码,然后单击 下一步..显示下一页。

如何在CentOS 8上安装WebERP

如何在CentOS 8上安装WebERP

输入公司名称,时区,管理员用户名,密码,然后单击。 安装 按钮。安装完成后,将显示下一页。

如何在CentOS 8上安装WebERP

输入管理员用户名和密码,然后单击 登录 按钮。 您将被重定向到webERP仪表板。

如何在CentOS 8上安装WebERP

结论

恭喜!您已经使用Apache和Let’s Encrypt SSL在CentOS 8上成功安装了webERP。现在,您可以在webERP中探索其他功能,并在生产环境中实现它们。

Sidebar