Report this

What is the reason for this report?

Spring Cleaning (What is var/www/html)?

Posted on February 22, 2015

I’m just doing some premature Spring cleaning, and wanted to know what the var/www/html folder was for, and if I could delete it. My websites are currently located at var/www/site-name, and that html folder is just sitting there with them, containing an index.hmtl, and info.php files. I’m fairly certain it’s just a default file from setup, but I wanted to be sure.

For the sake of education, let me know what created it (if not me, when I first started), and if I can remove it - thanks!

Using a LEMP stack.



This textbox defaults to using Markdown to format your 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.

This question was answered by @IMsupporting:

/var/www/html is the “default” directory things like Apache use as a webserver root.

If you have nothing in it, then its normally safe to drop as you serve sites from a different folder.

in all honesty, for simplicity what I tend to do is: Create a /var/www/html/index.php file ( The only file in that folder )

And then place this in it…

<?php header(“HTTP/1.1 301 Moved Permanently”); header(“Location: http://www.New-Website.com”); ?>

This way if for whatever odd reason someone or something ends up being fed or relying on that directory existing, its redirected to one of my websites.

Hope this helps.

View the original comment

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.