where to create the www folder?

January 6, 2015 7.4k views

when i first start with a clean ubuntu image, I have no www folder. where shall i create it? i saw some put it in var/www and others in root/www. does it matters? i use cloud 9 for coding and it points only to the root dir..

3 Answers

I hate using the mainstream /var/www/html/<domain>/public/<contents>, it’s just too long in my opinion.

I use /web/<domain>/<subdomain>/public/<contents>, the directives are set up in nginx and it works fine.
Just make sure www-data has access to the directory, /root or specific home folders probably won’t be a great idea.
Saying that, don’t put it in /bin /etc or any of the other binary/config folders, they’re there for a purpose.

It doesn’t really matter, as long as you configure the directives in the right way.

I use /var/www on all my websites for many years, without any problem! ( which is quite default )
If you prefer a more secure location, you could use something similar like /srv/www-data.

and do you manage to have different websites installed?
for example, when i try to put also codiad there: var/www/codiad - i cant get it to work

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!