I used to be able to access websites/files that were stored in the directory


I have not used this for a while, but now I have a need to store, media in this directory or in the directory


I noticed that my apache web server wasnt running correctly so I did a complete package removal and then reinstalled, but I am still unable to access a test page

in the directory
by going to


Is there some initial configuration I need to do to allow me to store HTML and media files in this directory and be able to access them from the browser?

I dont remember having to do anything before.

  • Which distro? Under RHEL + clones the default root is /var/www/html, not /var/www. – Mark Wagner Sep 17 '10 at 23:00
  • I hope that inde.html above is only a typo in your post and not your actual file name :). Also, can you please provide details on the error you're getting? Is it a 404? 403? 500? – uzzi09 Jun 29 '11 at 1:27

look at the apache2.conf & any related sites-enabled configs. It's quite possible that the package removal didn't remove them... and the install didn't replace them. In particular look for 3 things. #1: the "ServerRoot" (or DocumentRoot if it's a virtual host) and #2 look through all the entries & make sure you have at least ONE that has Allow from All (or your ip block) that includes your particular web root. #3 Check permissions. If the files are owned by root:root (or whoever) and have no global permissions... (i.e. rwxr-x---) the web server won't have access to the files to dish 'em out. In most linux-based OSes... apache is running as either www-data or httpd... so change the ownership (or group) of the files to whatever apache is running as... or give enough permissions to the files to allow access to 'em.

You can also flip through the logs to see what kinds of other issues are happening... it typically is quite verbose & will report why something couldn't be accessed.

Without more info about what error page you get... and/or info from your error.log... I can't be more specific as to what to check for.


pretty sure /var/www/html is the Document root on ubuntu.

grep -r Root /etc/apache2

That command should tell you the documentroot or serverroot set for your system. You can watch the logs by doing

tail -f /var/log/apache2/FILE

Ctrl-C to quit, and the filenames vary by installation, but if memory service, access_log and error_log are the ones you'll need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.