By Matt Porter
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!
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.