Where do i place web files?

October 26, 2014 4k 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?

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.

Have another answer? Share your knowledge.