nicolas@chateau:~$ sudo systemctl stop apache2
sudo mv /var/www/html/index.html /var/www/html/index.html.apache
nicolas@chateau:~$ sudo apt install {nginx-full,mariadb-{server,client},php,php-{fpm,mysql,curl,xml,mbstring,bcmath,gd,cli,zip}}
nicolas@chateau:~$ sudo mkdir -p /var/{www,lib/geneweb} nicolas@chateau:~$ sudo mount -a nicolas@chateau:~$ sudo usermod -aG www-data $USER nicolas@chateau:~$ sudo chown -R www-data:www-data /media/serveur/srv/www/ nicolas@chateau:~$ sudo chmod -R 2770 /media/serveur/srv/www nicolas@chateau:~$ sudo nginx
nicolas@chateau:~$ sudo systemctl is-active nginx active nicolas@chateau:~$ sudo systemctl is-active mariadb active
nicolas@chateau:~$ php -v PHP 8.1.2 (cli) (built: Aug 17 2022 13:08:39) (NTS)
nicolas@chateau:~$ sudo systemctl is-active php8.1-fpm.service active
(PHP-FPM est une alternative à PHP FastCGI)
nicolas@chateau:~$ sudo systemctl enable php8.1-fpm Synchronizing state of php8.1-fpm.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable php8.1-fpm
nicolas@chateau:~$ sudo mysql_secure_installation (...)Enter current password for root (enter for none):(...)Switch to unix_socket authentication [Y/n] (...) Change the root password? [Y/n]New password: Re-enter new password:Password updated successfully! (...)Remove anonymous users? [Y/n] (...) Disallow root login remotely? [Y/n] (...) Remove test database and access to it? [Y/n] (...) Reload privilege tables now? [Y/n](...)
/etc/nginx/sites-available/default
, restaurez les fichiers du répertoire /etc/nginx/sites-available/
et le fichier /etc/nginx/sites-available/default
:nicolas@chateau:~$ sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.dist nicolas@chateau:~$ sudo cp /media/l-reservoirs/svg/2022-08-31/chateau/etc/nginx/sites-available/* /etc/nginx/sites-available/ nicolas@chateau:~$ sudo cp /etc/nginx/sites-available/default.dist /etc/nginx/sites-available/default
nicolas@chateau:~$ ls -l /var/run/php/ ... srw-rw---- 1 www-data www-data 0 août 17 10:20 php8.1-fpm.sock ...
Ici : php8.1-fpm.sock
# Default server configuration # server { ... index index.php index.html index.htm index.nginx-debian.html; ... location ~ \.php$ { ... fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; ... } ... }
nicolas@chateau:~$ sudo ln -s /etc/nginx/sites-available/localhost /etc/nginx/sites-enabled/localhost nicolas@chateau:~$ sudo ln -s /etc/nginx/sites-available/chateau.parc /etc/nginx/sites-enabled/chateau.parc nicolas@chateau:~$ sudo ln -s /etc/nginx/sites-available/nfrappe.fr /etc/nginx/sites-enabled/nfrappe.fr
nicolas@chateau:~$ sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful nicolas@chateau:~$ sudo nginx -s reload