sudo apt update sudo apt install apache2
Aller sur http://localhost/. La page Apache2 Ubuntu Default Page s'affiche.
sudo apt install php libapache2-mod-php php-mysql
Tester le fonctionnement de PHP :
php -v
Se référer à cette page.
Éditer la configuration du site par défaut :
sudo vim /etc/apache2/sites-available/000-default.conf
Y coller la configuration suivante :
<VirtualHost *:80> ServerName localhost ServerAdmin myself@mail.com DocumentRoot /home/marc/PrgWeb <Directory /home/marc/PrgWeb/> Options Indexes FollowSymLinks Multiviews AllowOverride all Require all denied Require all granted Allow from all </Directory> </VirtualHost>
Ensuite relancer Apache :
sudo systemctl reload apache2
Écrire un fichier test.php :
Ensuite tester que tout fonctionne bien en allant sur http://localhost/test.php
-= Fin =-