Link to home
Start Free TrialLog in
Avatar of letharion
letharionFlag for Sweden

asked on

Apache access denied to directory

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
ASKER CERTIFIED SOLUTION
Avatar of Jon Brelie
Jon Brelie
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of letharion

ASKER

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 :)
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.
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.
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.