Apache access denied to directory

letharion
letharion used Ask the Experts™
on
I've just moved a Drupal site from development to production environment.
The site itself works, but all images are "broken".

It seems that apache denies all access to the "files/" directory where all the images are.
As far as I can tell all URLs point where they should.

Potentially related is that
1) I renamed the site from www.domain.com to new.domain.com during the move, in order to test out the site on the live server before actually replacing the current one.
2) The site has been setup with aegir, and the settings.php replaced with a "normal" one, in order to solve this problem. Didn't help though.

I'm not sure what information to provide. My first idea was to look at the .htaccess file in the files dir, but it's really short:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
System Architect
Commented:
chmod -R 755 files?

Author

Commented:
I only checked that _my_ user could read the files, and it didn't occur to me that I'm not apache.
doh!

That worked, for everything but a few files. I'm assuming the problem is something similar, I'm gonna look into it in more detail and I'll get back.

Thanks a lot :)
Jon BrelieSystem Architect

Commented:
chown -R apache.apache *
First make sure the directory is owned by apache and group ownership belongs to apache :

> chown -R apache:apache /var/www/yourwebdir
# chmod 775 /var/www/yourwebdir

Should fix the problem.
LinuxGuruLinux Server Administrator

Commented:
Hi,

You can check the apache error logs to locate the exact reason. Run the following command as root.

tail -f /usr/local/apache/logs/error_log

After that please try to access the page. You can see the exact error now. Paste the results here.

If the path "/usr/local/apache/logs/error_log" does not exist you may locate the error log using the command

locate error_log

Let me know if you have any questions.

Author

Commented:
Unfortunately I can't access the apache log on this host, and all files we're owned by the right user, but properly settings some file and directory permissions worked things out.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial