Base de connaissances

Déployer un site web sur mon VPS (Nginx + PHP) Imprimer

  • 0

Déployer un site web sur mon VPS (Nginx + PHP)

sudo apt update && sudo apt install nginx php-fpm php-mysql mariadb-server -y
sudo mkdir -p /var/www/mon-site && sudo chown -R www-data:www-data /var/www/mon-site

Créez un vHost Nginx :

sudo nano /etc/nginx/sites-available/mon-site
server {
  server_name mon-domaine.fr;
  root /var/www/mon-site;
  index index.php index.html;
  location ~ .php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php-fpm.sock;
  }
}
sudo ln -s /etc/nginx/sites-available/mon-site /etc/nginx/sites-enabled/
sudo systemctl reload nginx

Cette réponse était-elle pertinente?
« Retour