Forum Moderators: phranque

Message Too Old, No Replies

localhost error: 403 forbidden?

         

shams

2:28 am on Nov 21, 2006 (gmt 0)

10+ Year Member



hi,
when my Douments Roo was /var/www/html every thing was ok with the lolcal server, i changed the Documents Root to my home /home/ahmad/www/html, when i put my files, run the:
restorecon -R /home/ahmad
and changed the httpd.conf as:
DocumentRoot "/home/ahmad/www/html"
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "/home/ahmad/www/html">
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
Order allow,deny
Allow from all
</Directory>
when i open the [lcolhost,...] i got the error:
403 forbidden:
Forbidden
You don't have permission to access / on this server.
i check the /var/log/httpd/ for errors, the error was asking for .htaccess file to read, so i crated one in the html directory:
Options +Includes
AddType text/html shtml
AddHandler server-parsed shtml
Options +ExecCGI
AddHandler cgi-script cgi pl
now there is the same error when trying to open the [localhost:...]
403 forbidden
and the /var/log/httpd/error is at the time:
[Tue Nov 21 07:04:47 2006] [crit] [client ::1] (13)Permission denied: /home/ahmad/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Nov 21 07:06:34 2006] [crit] [client ::1] (13)Permission denied: /home/ahmad/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

these are the permissions:
drwxr-xr-x www users user_u:object_r:httpd_sys_content_t www
then:
-halZ www
drwxr-xr-x www users user_u:object_r:httpd_sys_content_t .
drwx------ ahmad ahmad system_u:object_r:user_home_dir_t ..
drwxr-xr-x www users user_u:object_r:httpd_sys_content_t html
then:
-rwxr-xr-x www users user_u:object_r:httpd_sys_content_t .htaccess
-rwxr-xr-x www users user_u:object_r:httpd_sys_content_t index.html
any one can help plase?

[edited by: jdMorgan at 4:39 am (utc) on Nov. 21, 2006]
[edit reason] Disabled smiley-faces in permissions list. [/edit]

jdMorgan

4:44 am on Nov 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An easy thing to try is to set every directory to ow:rwx sy:rwx wo:rwx (chmod 777) to start, and then remove permissions one at a time until it quits working again. It looks like the server can't get past the "ahmad" directory, because the permissions are restricted.

Jim