Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am getting 'Forbidden' 403 problem with my website. Earlier today it worked. The only thing I did was try to access other folders (eg bin). I checked permissions, and it all seems to be looking right. Any ideas how to solve this? what I should be looking for or doing?

Some of the suspicious error logs:

[Fri Mar 02 14:08:57 2012] [error] [client yyyyyyyy] script '/var/www/vhosts/example.com/httpdocs/file.php' not found or unable to stat
[Fri Mar 02 15:48:43 2012] [error] [client xxxxxxxx] (13)Permission denied: file permissions deny server access: /var/www/vhosts/example.com/httpdocs/index.html
[Fri Mar 02 15:45:33 2012] [crit] [client vvvvvvvvvvv] (13)Permission denied: /var/www/vhosts/example.com/httpdocs/folder/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

I found that I had .htaccess file under httpdocs, and so I deleted it, but it didn't seem to help. The domain still doesn't work.

share|improve this question
    
Can you find out if your server has SELinux enabled? If so, check /var/log/audit/audit.log for messages abut AVC denial. –  Ulrich Schwarz Mar 3 '12 at 6:29
add comment

1 Answer 1

The second error message seems to squarely point to it being a file permissions problem so here's a quick test to see where the problem might be. First switch to the correct user that apache is running as. I'm assuming it's www-data, but it may also be either apache, www, or something else. To find out for sure, you can try running ps -ef | grep apache or ps -ef | grep http depending on what the name is for apache. The user will be in the first column. To switch users, I normally use sudo su - www-data which will give a full login shell for www-data. Then start looking at files like this:

ls -ld /var/www/vhosts/example.com/httpdocs/index.html
ls -ld /var/www/vhosts/example.com/httpdocs
ls -ld /var/www/vhosts/example.com
ls -ld /var/www/vhosts
ls -ld /var/www

My guess is that the first few will fail until you find the directory where the permissions problem is. The first one that shows status should be the culprit.

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.