mukund1973
asked on
Unable to access User pages
Hello Experts,
I am facing problem accessing user pages using Apache on Redhat 9. As per guidelines I have enabled UserDir in Apache config. I have given proper file permissions 711 to User directory and 755 to public_html.
Whenever I am trying to access user pages using http://myhost/~user I am getting error "forbidden you don't have permission access....". Apache error log shows error "[Thu Mar 30 03:16:02 2006] [error] [client *.*.132.191] (13)Permission denied: access to /~mukund/index.html denied" whereas without specifying the user am able to view apache test page.
I am really confused and not able to locate the problem. What is gone wrong and how to resolve this problem ?
Following is the http conf...
<IfModule mod_userdir.c>
#UserDir disable
UserDir public_html
</IfModule>
<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
AllowOverride None
Options FollowSymLinks
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
I am facing problem accessing user pages using Apache on Redhat 9. As per guidelines I have enabled UserDir in Apache config. I have given proper file permissions 711 to User directory and 755 to public_html.
Whenever I am trying to access user pages using http://myhost/~user I am getting error "forbidden you don't have permission access....". Apache error log shows error "[Thu Mar 30 03:16:02 2006] [error] [client *.*.132.191] (13)Permission denied: access to /~mukund/index.html denied" whereas without specifying the user am able to view apache test page.
I am really confused and not able to locate the problem. What is gone wrong and how to resolve this problem ?
Following is the http conf...
<IfModule mod_userdir.c>
#UserDir disable
UserDir public_html
</IfModule>
<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
AllowOverride None
Options FollowSymLinks
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
ASKER
my user directory file permissions are 711 and public_html files permissions are 755. I have tried same settings on different linux box and its working properly there. both the linux box having same installation and setup.
ASKER
following are the file permissions for my user directory
drwx--x--x 3 mukund mukund 4096 Mar 30 04:59 mukund
and public_html
drwxr-xr-x 2 mukund mukund 4096 Mar 30 02:44 public_html
any clue ?
drwx--x--x 3 mukund mukund 4096 Mar 30 04:59 mukund
and public_html
drwxr-xr-x 2 mukund mukund 4096 Mar 30 02:44 public_html
any clue ?
Hi mukund1973.
I will show you what I have setup working on my server at home:
Basically, change the lines:
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
AllowOverride None
Options FollowSymLinks
To be:
MultiViews
Options All
AllowOverride None
Hope this helps!
Giles Williams,
CEO, QLE Internet Services.
http://www.qlehosting.com/
http://www.qledesign.com/
http://www.qleis.com/
I will show you what I have setup working on my server at home:
Basically, change the lines:
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
AllowOverride None
Options FollowSymLinks
To be:
MultiViews
Options All
AllowOverride None
Hope this helps!
Giles Williams,
CEO, QLE Internet Services.
http://www.qlehosting.com/
http://www.qledesign.com/
http://www.qleis.com/
I was talking about the dirs up to your user dir "/home/mukund/", so /home/ must be searchable for the user defined in the configuration (User directive), too.
Try to set the directory permissions for the directories /home/ /home/mukund/ /home/mukund/public_html/ to 701 (rwx-----x, that should be enough)
and all files to 704 (rwx---r--)
Try also to restart the httpd process.
Have you selinux enabled?
Try to set the directory permissions for the directories /home/ /home/mukund/ /home/mukund/public_html/ to 701 (rwx-----x, that should be enough)
and all files to 704 (rwx---r--)
Try also to restart the httpd process.
Have you selinux enabled?
ASKER
Sorry experts...I wasnt online due to illness. So wasnt able to reply on time.
Hi gileze33 ....i tried to change the config as per your suggessions but in vain....didnt work.
caterham..selinux is enabled at my linux box. also my file permissions are as per your suggession. but that didnt solved my problem yet!
I have already mentioned settings I am having in apache conf and file permissions..with same setup on other linux machine its working fine...
Is there anything wrong or missing ?
I have enabled iptables but I think that might not be a problem as I tried to access userpages by disabling the iptables but that too didnt worked.
Hi gileze33 ....i tried to change the config as per your suggessions but in vain....didnt work.
caterham..selinux is enabled at my linux box. also my file permissions are as per your suggession. but that didnt solved my problem yet!
I have already mentioned settings I am having in apache conf and file permissions..with same setup on other linux machine its working fine...
Is there anything wrong or missing ?
I have enabled iptables but I think that might not be a problem as I tried to access userpages by disabling the iptables but that too didnt worked.
Hi There.
Just out of interest, are you sure you are editing the write conf file?
What is its filename?
And, also, check to see that there are not duplicate files on the server.
Giles Williams.
Just out of interest, are you sure you are editing the write conf file?
What is its filename?
And, also, check to see that there are not duplicate files on the server.
Giles Williams.
ASKER
am bit sure that am editing right conf file. location of the httpd.con is /etc/httpd/conf. my server is using this file only.
Hi There.
If possible, could you post entire contents of conf file for analysis?
Thanks.
If possible, could you post entire contents of conf file for analysis?
Thanks.
> selinux is enabled
Did you check /var/log/messages (or similar)? There should be a kernel audit error.
try
chcon -R -h -t httpd_sys_content_t $HOME/public_html
Did you check /var/log/messages (or similar)? There should be a kernel audit error.
try
chcon -R -h -t httpd_sys_content_t $HOME/public_html
ASKER
hi caterham
it worked! Thanks a ton for your expert help! and I appreciate all the expert who replied to this possibly silly question!
I checked /var/log/messages and found kernel audit error. Although I really not understood what is it! I tried chcon and it worked! my userpages are now accessible.
by the way before closing this question could you please explain me whats the kernel audit error and chcon command all about?
or guide me where can i get proper knowledge about it ? I do not have much expertise on linux yet!
it worked! Thanks a ton for your expert help! and I appreciate all the expert who replied to this possibly silly question!
I checked /var/log/messages and found kernel audit error. Although I really not understood what is it! I tried chcon and it worked! my userpages are now accessible.
by the way before closing this question could you please explain me whats the kernel audit error and chcon command all about?
or guide me where can i get proper knowledge about it ? I do not have much expertise on linux yet!
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks caterham_www.
Aprciated your expert advice. Nice to meet you and other expert advisers here!
Thankx to Expert Exchange too.
Aprciated your expert advice. Nice to meet you and other expert advisers here!
Thankx to Expert Exchange too.
filesystem permissions. So your files are readable to the apache user and all dirs above (e.g. /home/) have the x-bit set so that they are sarchable?
May be a selinux problem/policy setting?