2 tutorials, differents paths?

October 22, 2013 6k views
First I followed this tutorial here https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04 and now I'm following this one right here https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3 but there seems to be a kind of a problem here because while on the first link the STEP SIX says to set root to "root /usr/share/nginx/www;" and in the second STEP FIVE sets the root to root /var/www/example.com/public_html; Do I have to go one way or the other?
8 Answers
You can put the root folder anywhere you want, just be sure that www-data:www-data are the owners, the tut is wrong.
What you mean is wrong? :S I'm adding my user to group www:data
NGINX already creates a user and group called www-data
if I access localhost/ I get Welcome to nginx! (from how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04 article). If I access I get Success: You Have Set Up a Virtual Host (from how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3)
"You can put the root folder anywhere you want..."

That is correct.

"... the tut is wrong."

I wouldn't say that the tut is wrong. At worst, misleading -- albeit, not intentionally -- in that it does not state that you can set the Nginx root directory just about anywhere you want. In addition to /var/www/, other popular locations are /srv/www/ and /home/user/.
The first one I know.
The second I've set to var/www

Following the two tutorials is a bit redundant right?
"Following the two tutorials is a bit redundant right?"

Yes; sorta. The two articles serve two distinct purposes. However, there is some overlap. Thus, to duplicate the overlapping portions of the two tutorials on your droplet... yes, that would be redundant.
Since you're going to host multiple websites on your droplet you should store them in /var/www/example.com/public_html
Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!