Skip to content

Instantly share code, notes, and snippets.

@fragolinux
Last active May 13, 2020 19:06
Show Gist options
  • Save fragolinux/7229c1785652e4598d0bb61e50aa9093 to your computer and use it in GitHub Desktop.
Save fragolinux/7229c1785652e4598d0bb61e50aa9093 to your computer and use it in GitHub Desktop.
# 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