Question

2 tutorials, differents paths?

  • Posted October 22, 2013

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?

Subscribe
Share

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

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.

Since you’re going to host multiple websites on your droplet you should store them in <code>/var/www/example.com/public_html</code>

<b>“Following the two tutorials is a bit redundant right?”</b> <br> <br>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.

The first one I know. <br>The second I’ve set to var/www <br> <br>Following the two tutorials is a bit redundant right?

<b>“You can put the root folder anywhere you want…”</b> <br> <br>That is correct. <br> <br><b>“… the tut is wrong.”</b> <br> <br>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 <code>root</code> directory just about anywhere you want. In addition to <code>/var/www/</code>, other popular locations are <code>/srv/www/</code> and <code>/home/user/</code>.

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 127.0.0.1 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)

NGINX already creates a user and group called www-data

What you mean is wrong? :S I’m adding my user to group www:data

You can put the root folder anywhere you want, just be sure that www-data:www-data are the owners, the tut is wrong.