Distribution de travail : LXLE 18.04 Hostname : server.local
util01@server:~$ sudo apt update util01@server:~$ sudo apt upgrade
util01@server:~$ sudo apt install apache2
util01@server:~$ sudo ufw allow in "Apache Full"
util01@server:~$ sudo apt install mysql-server
util01@server:~$ sudo mysql_secure_installation Press y|Y for Yes, any other key for No: New password: Re-enter new password: Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y util01@server:~$
util01@server:~$ sudo mysql mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mot2passe'; mysql> FLUSH PRIVILEGES; mysql> EXIT;
util01@server:~$ sudo apt install php libapache2-mod-php php-mysql
util01@server:~$ sudo systemctl restart apache2
Créer :
/var/www/html/info.php
Ajouter :
<?php phpinfo(); ?>
Adresse :
http://server.local/info.php
util01@server:~$ sudo apt-get install phpmyadmin
Adresse : http://server.local/phpmyadmin/
Ouvrir :
/etc/apache2/mods-available/php7.2.conf
Chercher et commenter :
<Directory /home/*/public_html> php_admin_flag engine Off </Directory>
Action :
util01@server:~$ sudo a2enmod userdir util01@server:~$ sudo systemctl restart apache2
util01@server:~$ mkdir public_html
Ouvrir :
~/public_html/index.php
Ajouter :
<?php echo "Utilisateur util01"; ?>
Adresse :
http://server.local/~util01/
https://www.ostechnix.com/install-apache-mysql-php-lamp-stack-on-ubuntu-18-04-lts/