2 tutorials, differents paths?

Posted October 22, 2013 6.4k views
First I followed this tutorial here and now I'm following this one right here 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/; Do I have to go one way or the other?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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/