Apache Forbidden error on clean CentOS install
I have a clean copy of CentOS.
Just installed Apache, PHP开发者_运维技巧 and MySQL. Everything works like a charm.
Except for I created a new user, let's call it 'demo'.
I created a new virtual directory in httpd.conf and pointed it to '/home/demo/www'. I created an empty index.html under '/home/demo/www'.
Apache is running under user 'apache' and group 'apache'.
Maybe user 'apache' does not have access to user 'demo's file, that's why I get the Forbidden problem?
Do you have any ideas how to solve this problem?
Thanks,
James
The solution was to give a 'chmod 755' to '/home/demo'.
Without seeing your config files It is difficult to find the right spot, however Apache will not show 403 if he does not have permissions on files.
403 means the client(your browser) has not a permission to view the content
I think you have a trailing slash problem. Just try this code:
<VirtualHost *:80>
ServerAdmin hello@demosite.com
DocumentRoot /home/demo/www/
ServerName DemoSite
ErrorLog logs/sb-error_log
CustomLog logs/sb-access_log common
</VirtualHost>
You need to add:
<Directory "/home/demo/www">
# Allow open access:
Require all granted
/Directory>
To your Virtual Host definition.
精彩评论