where to create the www folder?

  • Posted January 6, 2015

hey. 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…


This comment has been deleted

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.

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.

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

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.