Skip to content

Instantly share code, notes, and snippets.

@lloydroc
Last active December 23, 2016 04:53
Show Gist options
  • Save lloydroc/32aea686ef36c60d58ee1d47f76f1024 to your computer and use it in GitHub Desktop.
Save lloydroc/32aea686ef36c60d58ee1d47f76f1024 to your computer and use it in GitHub Desktop.
# run multiple websites from nginx
# https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
chgrp -R www-data /var/www
sudo chmod 775 /var/www
sudo mkdir -p /var/www/example.com/public_html
sudo chown -R www-data:www-data /var/www/example.com/public_html
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com
sudo vi /etc/nginx/sites-available/example.com
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment