Nginx Install
install
Remove apache2
- In case for any error, stop apache first:
sudo service apache2 stop sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common sudo apt-get autoremove
Restart
- service nginx start
- check start status -> systemctl status nginx.service
- systemctl restart nginx
- Default root folder /var/www/html
Full remove
- sudo apt-get remove nginx nginx-common # Removes all but config files.
- sudo apt-get purge nginx nginx-common # Removes everything.
- sudo apt-get autoremove
Upgrade
- Add the sources
sudo echo "
deb http://packages.dotdeb.org jessie all
deb http://nginx.org/packages/mainline/debian/ jessie nginx" | sudo tee -a /etc/apt/sources.list
# Add the keys to our system so we trust packages from the sources we added
cd /tmp
wget http://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
# finally install nginx
sudo apt update && sudo apt install nginx-full -y