Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

/var/www

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

/var/www/images

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

inde.html
in the directory
/var/www/index.html
by going to

http://myipaddresshere/index.html

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.

share|improve this question
    
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
add comment

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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