sudo apt-get install php7.2 php7.2-fpm php7.3 php7.3-fpm libapache2-mod-fcgid -y
sudo systemctl start php7.2-fpm
sudo systemctl start php7.3-fpm
sudo a2enmod actions fcgid alias proxy_fcgi
sudo systemctl restart apache2
Par défaut, le serveur Apache fonctionne comme un utilisateur www-data et un groupe www-data. Pour vous assurer que vous avez la propriété et les permissions correctes des répertoires root de votre site web, exécuter les commandes suivantes :
sudo chown -R www-data:www-data /var/www/site1.your_domain
sudo chown -R www-data:www-data /var/www/site2.your_domain
sudo chmod -R 755 /var/www/site1.your_domain
sudo chmod -R 755 /var/www/site2.your_domain
ServerAdmin admin@site1.your_domain
ServerName site1.your_domain
DocumentRoot /var/www/site1.your_domain
DirectoryIndex info.php
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server
SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost"
ErrorLog ${APACHE_LOG_DIR}/site1.your_domain_error.log
CustomLog ${APACHE_LOG_DIR}/site1.your_domain_access.log combined
Enregistrer et fermer le fichier lorsque vous avez terminé. Vérifier ensuite le fichier de configuration Apache pour toutes erreurs de syntaxe :
sudo apachectl configtest
Enfin, redémarrer le service Apache pour implémenter vos changements :
sudo systemctl restart apache2