How to install WebERP on CentOS 8
webERP is a free, open source, complete web-based accounting and business management system. You only need a web browser and PDF reader to use webERP. Using webERP, you can manage many things, including purchase orders, online stores, manufacturing, sales, general ledger, and shipping. It is written in PHP and uses MariaDB as the database backend. This tutorial will show you how to install webERP on Apache and encrypt SSL on CentOS 8.
prerequisites
- Server running CentOS 8.
- A valid domain name pointing to the server IP.
- The root password is configured on the server.
Install LAMP server
First, install Apache, MariaDB, PHP and other PHP extensions using the following commands:
dnf install httpd mariadb-server php php-mysqli php-curl php-json php-cgi php-xmlrpc php-gd php-mbstring unzip -y
After installing all the packages, use the following commands to start the Apache and MariaDB services and enable them to start when the system reboots:
systemctl start httpd mariadbsystemctl enable httpd mariadb
Once completed, you can proceed to the next step.
Configure MariaDB
Next, you will need to set the MariaDB root password and ensure the security of the MariaDB installation. You can use the following commands to do so:
mysql_secure_installation
Answer all questions as follows:
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!
Next, log in to the MariaDB shell using the following command:
mysql -u root -p
After connecting, use the following command to create a database and user for webERP:
MariaDB [(none)]> create database weberp;MariaDB [(none)]> create user [email protected] identified by 'password';
Next, use the following command to grant all privileges to the webERP database:
MariaDB [(none)]> grant all privileges on weberp.* to [email protected] identified by 'password';
Next, refresh the privileges and exit from MariaDB using the following command:
MariaDB [(none)]> flush privileges;MariaDB [(none)]> exit;
Once completed, you can proceed to the next step.
Install webERP
First, use the following command to download the latest version of webERP:
wget https://sourceforge.net/projects/web-erp/files/webERP_4.15.zip
After the download is complete, use the following command to extract the downloaded file to the Apache Web root directory:
unzip webERP_4.15.zip -d /var/www/html
Next, use the following commands to set the appropriate permissions and ownership:
chown -R apache:apache /var/www/html/webERPchmod -R 755 /var/www/html/webERP
Once completed, you can proceed to the next step.
Configure Apache for WebERP
Next, you will need to create a new Apache virtual host configuration file to host webERP. You can create it with the following command:
nano /etc/httpd/conf.d/weberp.conf
Add the following line:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/webERP ServerName weberp.googlesyndication.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>
Save and close the file when you are done. Next, restart the Apache service to apply the changes:
systemctl restart httpd
Now, use the following command to verify the status of Apache:
systemctl status httpd
You should get the following output:
? 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...
At this point, the Apache web server has been configured to host webERP. You can now proceed to the next step.
Let’s encrypt SSL to protect webERP
Next, you will need to install the Certbot client to install “Let’s Encrypt SSL” for WebERP. You can use the following command to install:
dnf install letsencrypt python3-certbot-apache
Next, use the following command to obtain and install an SSL certificate for your domain:
certbot --apache -d weberp.googlesyndication.com
You will be asked to provide your email address and accept the terms of service:
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.googlesyndication.com Performing the following challenges: http-01 challenge for weberp.googlesyndication.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.googlesyndication.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.googlesyndication.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/weberp.googlesyndication.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
You can now use the URL to safely visit your website https://weberp.googlesyndication.com .
Configure firewall
Next, you will need to allow ports 80 and 443 to pass through the firewall. You can allow them with the following command:
firewall-cmd --permanent --add-service=httpfirewall-cmd --permanent --add-service=https
Next, reload the firewall to apply the changes:
firewall-cmd --reload
Access webERP web interface
Now, open your web browser and use the URL to access the webERP web interface https://weberp.googlesyndication.com . You should see the following page:
Choose your language and click Next step . You should see the following page:
Provide your database name, user, password, and click Next step . You should see the following page:
Provide your company name, time zone, administrator username, password, and click installation Button. After the installation is complete, you should see the following page:
Provide your administrator username and password, and click log in Button. You will be redirected to the webERP dashboard:
in conclusion
Congratulations! You have successfully installed webERP using Apache and let us encrypt SSL on CentOS 8. Now, you can explore webERP to get more features and implement them in a production environment.