Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

closed as unclear what you're asking by Jeff Schaller, Anthon, Thomas Dickey, cuonglm, terdon Jun 20 at 12:16

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the 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

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

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