Question

Where do i place web files?

Posted October 26, 2014 5.2k views

if i want to display php files and have already configured my server to do so(ubuntu 14.04), do i need to place files in the html folder?

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.

×
3 answers

You should place your web files in www folder You can access it by running cd /var/www/ from terminal.

If you only host one site on your server you can put them into the default document root which I believe is /var/www/html.

If you host multiple sites you can create a sub directory in /var/www/html for every site. Just make sure that the default server block is not serving from that folder and create separate server blocks to every site.

It is not necessary to use /var/www/html for this. You can put them anywhere you want them within reason. Just make sure that the file permissions are safe and the server blocks have the right document roots.

It depends, if you are using a control panel usually the home directory is the document root for websites.
If not, go as the others suggested.

Submit an Answer