webERP es un sistema de administración empresarial y de contabilidad gratuito, de código abierto y completo basado en la web. Solo necesita un navegador web y un lector de PDF para usar webERP. Con webERP, puede administrar muchas cosas, incluidas las órdenes de compra, la tienda web, la fabricación, las ventas, el libro mayor y el envío. Está escrito en PHP y utiliza MariaDB como base de datos. Este tutorial le mostrará cómo instalar webERP con Apache y Let's Encrypt SSL en CentOS 8.
Requisitos
- Un servidor que ejecuta CentOS 8.
- Un nombre de dominio válido apuntado con la IP de su servidor.
- Se configura una contraseña raíz en el servidor.
Instalar servidor LAMP
Primero, instale Apache, MariaDB, PHP y otras extensiones PHP usando el siguiente comando:
dnf install httpd mariadb-server php php-mysqli php-curl php-json php-cgi php-xmlrpc php-gd php-mbstring unzip -y
Una vez que todos los paquetes estén instalados, inicie el servicio Apache y MariaDB y habilítelos para que se inicien al reiniciar el sistema usando el siguiente comando:
systemctl start httpd mariadb
systemctl enable httpd mariadb
Una vez que haya terminado, puede continuar con el siguiente paso.
Configurar MariaDB
A continuación, deberá establecer una contraseña raíz de MariaDB y asegurar la instalación de MariaDB. Puedes hacerlo con el siguiente comando:
mysql_secure_installation
Responda todas las preguntas como se muestra a continuación:
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!
A continuación, inicie sesión en el shell de MariaDB con el siguiente comando:
mysql -u root -p
Una vez conectado, cree una base de datos y un usuario para webERP con el siguiente comando:
MariaDB [(none)]> create database weberp;
MariaDB [(none)]> create user [email protected] identified by 'password';
A continuación, otorgue todos los privilegios a la base de datos webERP con el siguiente comando:
MariaDB [(none)]> grant all privileges on weberp.* to [email protected] identified by 'password';
A continuación, elimine los privilegios y salga de MariaDB con el siguiente comando:
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;
Una vez que haya terminado, puede continuar con el siguiente paso.
Instalar webERP
Primero, descargue la última versión de webERP con el siguiente comando:
wget https://sourceforge.net/projects/web-erp/files/webERP_4.15.zip
Una vez que se complete la descarga, extraiga el archivo descargado al directorio raíz web de Apache usando el siguiente comando:
unzip webERP_4.15.zip -d /var/www/html
A continuación, establezca el permiso y la propiedad adecuados con el siguiente comando:
chown -R apache:apache /var/www/html/webERP
chmod -R 755 /var/www/html/webERP
Una vez que haya terminado, puede continuar con el siguiente paso.
Configurar Apache para webERP
A continuación, deberá crear un nuevo archivo de configuración de host virtual de Apache para alojar el webERP. Puedes crearlo usando el siguiente comando:
nano /etc/httpd/conf.d/weberp.conf
Agregue las siguientes líneas:
<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>
Guarde y cierre el archivo cuando haya terminado. A continuación, reinicie el servicio Apache para aplicar los cambios:
systemctl restart httpd
Ahora, verifique el estado de Apache con el siguiente comando:
systemctl status httpd
Deberías obtener el siguiente resultado:
? 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...
En este punto, el servidor web Apache está configurado para alojar webERP. Ahora puede continuar con el siguiente paso.
WebERP seguro con Let's Encrypt SSL
A continuación, deberá instalar el cliente Certbot para instalar Let's Encrypt SSL para webERP. Puede instalarlo con el siguiente comando:
dnf install letsencrypt python3-certbot-apache
Luego, obtenga e instale un certificado SSL para su dominio con el siguiente comando:
certbot --apache -d weberp.example.com
Se le pedirá que proporcione su dirección de correo electrónico y acepte el término del servicio:
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
Ahora puede acceder a su sitio web de forma segura utilizando la URL https://weberp.example.com .
Configurar cortafuegos
A continuación, deberá permitir los puertos 80 y 443 a través del firewall. Puede permitirlos con el siguiente comando:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
A continuación, vuelva a cargar el cortafuegos para aplicar los cambios:
firewall-cmd --reload
Acceder a la interfaz web webERP
Ahora, abra su navegador web y acceda a la interfaz web de webERP usando la URL https://weberp.example.com . Debería ver la siguiente página:
Seleccione su idioma y haga clic en SIGUIENTE PASO . Debería ver la siguiente página:
Proporcione su nombre de base de datos, usuario, contraseña y haga clic en SIGUIENTE PASO . Debería ver la siguiente página:
Proporcione el nombre de su empresa, la zona horaria, el nombre de usuario del administrador, la contraseña y haga clic en INSTALAR botón. Una vez finalizada la instalación, debería ver la siguiente página:
Proporcione su nombre de usuario y contraseña de administrador y haga clic en Iniciar sesión botón. Será redirigido al panel webERP:
Conclusión
¡Felicidades! Ha instalado correctamente webERP con Apache y Let's Encrypt SSL en CentOS 8. Ahora puede explorar webERP para obtener más funciones e implementarlas en su entorno de producción.