Skip to content

Instantly share code, notes, and snippets.

Last active May 13, 2020 19:06
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# run this on a Debian Buster system setup by Peter Scargill's "The Script" to replace APACHE with NGINX, AFTER his script run...
# completely replace apache for nginx
sudo apt-get -y remove --purge *apache* *php*
sudo apt-get -y autoremove
sudo apt-get -y install nginx sqlite3 php php7.3-{common,cli,fpm,json,zip,gd,mbstring,curl,xml,bcmath,sqlite3} php-pear
# sudo apt-get -y install php7.3-pear # a line on its own as it caused instal issues to some...
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
sudo sed -i -e 's/index index.html/index index.php index.html/g' /etc/nginx/sites-enabled/default
sudo sed -i -e 's/#location ~ \\.php$ {/location ~ \\.php$ {/g' /etc/nginx/sites-enabled/default
sudo sed -i -e 's/#.*include snippets/ include snippets/g' /etc/nginx/sites-enabled/default
sudo sed -i -e 's/#.*fastcgi_pass unix/ fastcgi_pass unix/g' /etc/nginx/sites-enabled/default
sudo sed -i -e '63s/#}/}/' /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl restart nginx php7.3-fpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment