GNU/Linux >> Tutoriels Linux >  >> Debian

Comment installer InvoicePlane avec Apache et Free Lets Encrypt SSL Certificate sur Debian 11

InvoicePlane est une application gratuite, open source et auto-hébergée pour gérer vos devis, factures, clients et paiements. Il est utilisé par de nombreuses organisations et indépendants pour gérer leurs paiements et leurs factures. Il propose des modèles personnalisés, des thèmes et d'autres outils qui vous aident à augmenter les fonctionnalités d'InvoicePlane. Il prend également en charge plusieurs langues et plusieurs fournisseurs de paiement tels que Paypal, Stripe ou même Bitcoin via Coinbase.

Dans ce tutoriel, nous allons vous montrer comment installer InvoicePlane avec Apache sur Debian 11.

Prérequis

  • Un serveur exécutant Debian 11.
  • Un nom de domaine valide pointé vers l'adresse IP de votre serveur.
  • Un mot de passe root est configuré sur le serveur.

Installer Apache, PHP et MariaDB

Tout d'abord, vous devrez installer le serveur Web Apache, le serveur de base de données MariaDB, PHP et les autres extensions PHP requises sur votre serveur. Vous pouvez tous les installer en exécutant la commande suivante :

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql wget unzip php-cli php-zip php-curl -y

Une fois tous les packages installés, éditez le fichier de configuration PHP et modifiez les paramètres par défaut :

nano /etc/php/7.4/apache2/php.ini

Modifiez les lignes suivantes :

memory_limit = 256M
upload_max_filesize = 128M
max_execution_time = 360
date.timezone = UTC

Enregistrez et fermez le fichier puis redémarrez le service Apache pour appliquer les modifications :

systemctl restart apache2

Créer une base de données pour InvoicePlane

Ensuite, vous devrez sécuriser l'installation de MariaDB et créer une base de données et un utilisateur pour InvoicePlane.

Tout d'abord, sécurisez l'installation de MariaDB à l'aide de la commande suivante :

mysql_secure_installation

Répondez à toutes les questions comme indiqué ci-dessous :

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

Ensuite, connectez-vous au shell MariaDB avec la commande suivante :

mysql -u root -p

Une fois connecté, créez une base de données et un utilisateur pour InvoicePlane avec la commande suivante :

MariaDB [(none)]> CREATE DATABASE invplanedb;
MariaDB [(none)]> CREATE USER 'invplane'@'localhost' IDENTIFIED BY 'password';

Ensuite, accordez tous les privilèges à InvoicePlane avec la commande suivante :

MariaDB [(none)]> GRANT ALL PRIVILEGES ON invplanedb.* TO 'invplane'@'localhost';

Ensuite, exécutez la commande FLUSH PRIVILEGES pour que la table des privilèges soit rechargée par MariaDB :

MariaDB [(none)]> FLUSH PRIVILEGES;

Enfin, quittez le shell MariaDB :

MariaDB [(none)]> EXIT

Installer InvoicePlane

Tout d'abord, téléchargez la dernière version d'InvoicePlane avec la commande suivante :

wget -c -O v1.5.11.zip https://invoiceplane.com/download/v1.5.11

Une fois le téléchargement terminé, créez un répertoire pour InvoicePlane et extrayez le fichier téléchargé dans le répertoire InvoicePlane :

mkdir /var/www/html/invoiceplane
unzip v1.5.11.zip -d /var/www/html/invoiceplane

Ensuite, accédez au répertoire InvoicePlane et renommez le fichier de configuration et le fichier .htaccess :

cd /var/www/html/invoiceplane
cp ipconfig.php.example ipconfig.php
cp htaccess .htaccess

Ensuite, éditez le fichier ipconfig.php avec la commande suivante :

nano ipconfig.php

Définissez l'URL de votre site Web et les paramètres de base de données comme indiqué ci-dessous :

IP_URL=http://invoice.example.com
DB_HOSTNAME=localhost
DB_USERNAME=invplane
DB_PASSWORD=password
DB_DATABASE=invplanedb
DB_PORT=3306

Ensuite, définissez l'autorisation et la propriété appropriées pour le répertoire InvoicePlane :

chown -R www-data:www-data /var/www/html/invoiceplane/
chmod -R 755 /var/www/html/invoiceplane/

Configurer Apache pour InvoicePlane

Ensuite, vous devrez créer un fichier de configuration d'hôte virtuel Apache pour InvoicePlane. Vous pouvez le créer avec la commande suivante :

nano /etc/apache2/sites-available/invoiceplane.conf

Ajoutez les lignes suivantes :

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/invoiceplane
     ServerName invoice.example.com


     <Directory /var/www/html/invoiceplane/>
          Options +FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Enregistrez et fermez le fichier puis activez l'hôte virtuel Apache et réécrivez le module avec la commande suivante :

a2ensite invoiceplane.conf
a2enmod rewrite

Ensuite, redémarrez le service Apache pour appliquer les modifications de configuration :

systemctl restart apache2

Pour vérifier l'état d'Apache, exécutez la commande suivante :

systemctl status apache2

Vous obtiendrez le résultat suivant :

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-01-21 08:42:34 UTC; 5s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 15965 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 15970 (apache2)
      Tasks: 6 (limit: 2341)
     Memory: 15.1M
        CPU: 82ms
     CGroup: /system.slice/apache2.service
             ??15970 /usr/sbin/apache2 -k start
             ??15971 /usr/sbin/apache2 -k start
             ??15972 /usr/sbin/apache2 -k start
             ??15973 /usr/sbin/apache2 -k start
             ??15974 /usr/sbin/apache2 -k start
             ??15975 /usr/sbin/apache2 -k start

Jan 21 08:42:34 debian11 systemd[1]: Starting The Apache HTTP Server...

Accéder à l'interface utilisateur Web InvoicePlane

Maintenant, ouvrez votre navigateur Web et accédez à l'interface Web d'InvoicePlane à l'aide de l'URL http://invoice.example.com . Vous devriez voir la page suivante :

Cliquez sur Configuration bouton. Vous devriez voir la page de sélection de la langue :

Sélectionnez votre langue et cliquez sur Continuer bouton. Vous devriez voir la page des prérequis :

Cliquez sur Continuer bouton. Vous devriez voir la page suivante :

Cliquez sur Continuer bouton. Vous devriez voir la page suivante :

Cliquez sur Continuer bouton. Vous devriez voir la page suivante :

Fournissez les informations de votre compte d'utilisateur administrateur, votre adresse et cliquez sur Continuer bouton. Une fois InvoicePlane installé, vous devriez voir la page suivante :

Cliquez sur Connexion bouton. Vous devriez voir la page suivante :

Indiquez votre nom d'utilisateur administrateur, votre mot de passe, puis cliquez sur Connexion bouton. Vous devriez voir le tableau de bord InvoicePlane sur la page suivante :

Sécuriser InvoicePlane avec Let's Encrypt SSL

C'est toujours une bonne idée de sécuriser votre site Web avec Let's Encrypt SSL. Vous devrez installer le client Certbot pour installer et gérer le SSL. Vous pouvez l'installer avec la commande suivante :

apt-get install python3-certbot-apache -y

Une fois le Certbot installé, exécutez la commande suivante pour sécuriser votre site Web avec Let's Encrypt SSL :

certbot --apache -d invoice.example.com

Il vous sera demandé de fournir votre adresse e-mail et d'accepter les conditions d'utilisation comme indiqué ci-dessous :

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
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 at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing 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
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for invoice.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/invoice-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/invoice-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/invoice-le-ssl.conf

Ensuite, sélectionnez si vous souhaitez ou non rediriger le trafic HTTP vers HTTPS comme indiqué ci-dessous :

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Tapez 2 et appuyez sur Entrée pour installer le SSL Let's Encrypt pour votre site Web :

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/invoice.conf to ssl vhost in /etc/apache2/sites-available/invoice-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://invoice.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=invoice.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/invoice.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/invoice.example.com/privkey.pem
   Your cert will expire on 2022-04-23. 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

Conclusion

Toutes nos félicitations! vous avez installé avec succès InvoicePlane avec Apache et Let's Encrypt SSL sur Debian 11. Vous pouvez maintenant implémenter InvoicePlane dans votre entreprise et commencer à gérer vos paiements et factures depuis le navigateur Web.


Debian
  1. Comment installer Tiki Wiki avec Apache et permet de chiffrer SSL sur Debian 10

  2. Comment installer Automad CMS avec Apache et Lets encrypt sur Debian 10

  3. Comment installer ElkArte Forum avec Apache et Lets Encrypt sur Debian 10

  4. Comment installer OpenCart avec Nginx et Lets Encrypt sur Debian 10

  5. Comment installer Drupal 9 avec Nginx et Lets Encrypt SSL sur Debian 10

Comment installer Etherpad avec Nginx et SSL sur Debian 11

Comment installer Gitea avec Nginx et Lets Encrypt SSL gratuit sur Ubuntu 20.04

Comment installer Lighttpd avec PHP, MariaDB et Lets Encrypt SSL sur Debian 10

Comment installer Wekan Kanban avec Nginx et Lets Encrypt SSL sur Debian 10

Comment installer WordPress avec Apache et Let's Encrypt SSL sur Debian 11

Installez et configurez Webmin avec le certificat SSL Let's Encrypt gratuit sur Debian 10