Skip to content

Instantly share code, notes, and snippets.

@fragolinux fragolinux/nginx4apache
Last active Aug 11, 2019

Embed
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,pear,bcmath,sqlite3}
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
You can’t perform that action at this time.