Question

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

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.

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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