We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Unable to access User pages

mukund1973 asked
Medium Priority
Last Modified: 2010-03-04
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
<Directory /home/*/public_html>
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    AllowOverride None
    Options FollowSymLinks
        Order allow,deny
        Allow from all
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
Watch Question

Top Expert 2008

> What is gone wrong and how to resolve this problem ?

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?


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.


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 ?

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:

Options All
AllowOverride None

Hope this helps!

Giles Williams,
CEO, QLE Internet Services.
Top Expert 2008

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?


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 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.


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?

Top Expert 2008

> selinux is enabled

Did you check /var/log/messages (or similar)? There should be a kernel audit error.


chcon -R -h -t httpd_sys_content_t $HOME/public_html


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!

Top Expert 2008
This is caused by SELinux. The SELinix label settings forbid access to that dir. SELinux is a kernal enhancement, so the filesystemoperation fails, because th kernal says "no".

chcon = change security context. It changes the SELinux label

httpd_sys_content_t is a label from SELinux for .html / static files. (httpd_sys_script_exec_t would permit CGI execution).

-R = recursive. So if there are other subfolders with different label settings in place, they're changed, too.

-h = symbolic links are modifyed, too.

-t is the qualifier to modify the the label of the directory (here to to httpd_sys_content_t).

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Thanks caterham_www.

Aprciated your expert advice. Nice to meet you and other expert advisers here!
Thankx to Expert Exchange too.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.