Ricerca nel sito web

Come installare WebERP su CentOS 8


Su questa pagina

  1. Prerequisiti
  2. Installa il server LAMP
  3. Configura MariaDB
  4. Installa webERP
  5. Configura Apache per webERP
  6. Sicurezza webERP con Lets Encrypt SSL
  7. Configura firewall
  8. Accedi all'interfaccia web di webERP
  9. Conclusione

webERP è un sistema di contabilità e gestione aziendale gratuito, open-source e completo basato sul web. Hai solo bisogno di un browser web e di un lettore PDF per utilizzare il webERP. Con webERP, puoi gestire molte cose tra cui ordini di acquisto, web store, produzione, vendite, contabilità generale e spedizione. È scritto in PHP e utilizza MariaDB come backend del database. Questo tutorial ti mostrerà come installare webERP con Apache e Lets Encrypt SSL su CentOS 8.

Prerequisiti

  • Un server che esegue CentOS 8.
  • Un nome di dominio valido indicato con l'IP del tuo server.
  • Sul server è configurata una password di root.

Installa LAMP Server

Innanzitutto, installa Apache, MariaDB, PHP e altre estensioni PHP utilizzando il seguente comando:

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

Una volta installati tutti i pacchetti, avvia il servizio Apache e MariaDB e abilitali all'avvio al riavvio del sistema utilizzando il seguente comando:

systemctl start httpd mariadb
systemctl enable httpd mariadb

Una volta terminato, puoi procedere al passaggio successivo.

Configura MariaDB

Successivamente, dovrai impostare una password di root MariaDB e proteggere l'installazione di MariaDB. Puoi farlo con il seguente comando:

mysql_secure_installation

Rispondi a tutte le domande come mostrato di seguito:

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!

Successivamente, accedi alla shell MariaDB con il seguente comando:

mysql -u root -p

Una volta connesso, crea un database e un utente per webERP con il seguente comando:

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

Successivamente, concedi tutti i privilegi al database webERP con il seguente comando:

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

Successivamente, scarica i privilegi ed esci da MariaDB con il seguente comando:

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

Una volta terminato, puoi procedere al passaggio successivo.

Installa webERP

Innanzitutto, scarica l'ultima versione di webERP con il seguente comando:

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

Una volta completato il download, estrai il file scaricato nella directory root web di Apache usando il seguente comando:

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

Quindi, imposta l'autorizzazione e la proprietà appropriate con il seguente comando:

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

Una volta terminato, puoi procedere al passaggio successivo.

Configura Apache per webERP

Successivamente, sarà necessario creare un nuovo file di configurazione dell'host virtuale Apache per ospitare il webERP. Puoi crearlo usando il seguente comando:

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

Aggiungi le seguenti righe:

<VirtualHost *:80> 
ServerAdmin 
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> 

Salva e chiudi il file quando hai finito. Successivamente, riavvia il servizio Apache per applicare le modifiche:

systemctl restart httpd

Ora, verifica lo stato di Apache con il seguente comando:

systemctl status httpd

Dovresti ottenere il seguente 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...

A questo punto, il web server Apache è configurato per ospitare webERP. Ora puoi procedere al passaggio successivo.

Proteggi il webERP con Lets Encrypt SSL

Successivamente, dovrai installare il client Certbot per installare Lets Encrypt SSL per webERP. Puoi installarlo con il seguente comando:

dnf install letsencrypt python3-certbot-apache

Successivamente, ottieni e installa un certificato SSL per il tuo dominio con il seguente comando:

certbot --apache -d weberp.example.com

Ti verrà chiesto di fornire il tuo indirizzo email e di accettare i termini di servizio:

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): 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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: ).


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

Ora puoi accedere al tuo sito web in modo sicuro utilizzando l'URL https://weberp.example.com.

Configura firewall

Successivamente, dovrai consentire le porte 80 e 443 attraverso il firewall. Puoi consentirli con il seguente comando:

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

Successivamente, ricarica il firewall per applicare le modifiche:

firewall-cmd --reload

Accedi all'interfaccia web di webERP

Ora, apri il tuo browser web e accedi all'interfaccia web webERP utilizzando l'URL https://weberp.example.com. Dovresti vedere la seguente pagina:

Seleziona la tua lingua e clicca su PASSO SUCCESSIVO. Dovresti vedere la seguente pagina:

Fornisci il nome del database, l'utente, la password e fai clic su PASSO SUCCESSIVO. Dovresti vedere la seguente pagina:

Fornisci il nome della tua azienda, il fuso orario, il nome utente dell'amministratore, la password e fai clic sul pulsante INSTALLA. Una volta terminata l'installazione, dovresti vedere la seguente pagina:

Fornisci il nome utente e la password dell'amministratore e fai clic sul pulsante Accedi. Verrai reindirizzato alla dashboard webERP:

Conclusione

Congratulazioni! hai installato correttamente webERP con Apache e Lets Encrypt SSL su CentOS 8. Ora puoi esplorare webERP per ulteriori funzionalità e implementarle nel tuo ambiente di produzione.