Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am just getting Apache 2.2 running on Fedora 13 Beta 64-bit. I am running into issues setting my per-user directory. The goal is to make localhost/~user map to /home/~user/public_html. I think that I have the permissions right because I have 755 to /home/~user, and I have 755 to /home/~user/public_html/ and I have 777 for all contents inside of /home/~user/public_html/ recursively set.

My mod_userdir configuration looks like this:

<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disabled root
UserDir enabled huckphin

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
UserDir public_html

The error that I am seeing in the error log is this:

[Sat May 15 09:54:29 2010] [error] [client 127.0.0.1] (13)Permission denied: access to /~huckphin/index.html denied

When I login as the apache user, I know that /~huckphin does not exist, and this is not what I want. I want it to be accessing ~huckphin, not /~huckphin. What do I need to change on my configuration for this to work?

[Added after comments]

Hi Andol, thank you for your suggestions. So, first off, you said that you assume that I have the userdir module enabled, but I am not sure what that means exactly. That could be part of the problem.

I do have the Module loaded, using the LoadModule directive. I have this:

LoadModule userdir_module modules/mod_userdir.so

I also did a find on where mod_userdir is, and I found it located here:

[huckphin@crhyner-workbox]/% find / . -name '*mod_userdir.so*' 2> /dev/null
/usr/lib64/lighttpd/mod_userdir.so
/usr/lib64/httpd/modules/mod_userdir.so

Is there something else I need to enable?

Also, my directory configuration was mentioned. I have uncommented the default configuration given. I have not looked into what all of the configurations mean, and this could probably explain the issue. Here is the Directory that I have for the user directories:

<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
    Order allow,deny
    Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
    Order deny,allow
    Deny from all
</LimitExcept>
</Directory>
share|improve this question

2 Answers 2

Actually, when Apache refers to /~foo/ in its log files, it is talking about the url, and not the file system path. In other words, there's nothing suggesting that it's looking at the wrong place.

I assume you also have the userdir module enabled, not just the configuration? What about the Directory configuration for /home/*/public_html? Also, what about the file system permissions for /home?

share|improve this answer
    
make sure the user's directory can be traversed by apache. it needs full read permissions to /home/user/public_html i.e. chmod 755 /home/user/public_html and execute permissions on /home/user/, i.e. chmod 711 /home/user if i recall correctly, 711 is the minimum. –  cpbills May 15 '10 at 16:16
    
Hi cpbills, thanks for the suggestion. I have logged in as the apache user using root, and I am able to traverse the /home/user/public_html directory, so I believe that I have set the permissions correctly. I do have /home/user set to 755, and /home/user/public_html set to 755, and everything under /home/user/public_html/* to 777, so I think that my permissions are set. –  Huckphin May 17 '10 at 2:30
    
Hi andol. I have added my settings for <Directory>. Also, my permissions for home is set to 755. –  Huckphin May 17 '10 at 2:38

I'm a little upset. I found the answer, but it was just a guess. Sure enough, nothing about my configuration was incorrect. I stopped SELinux by going to System -> Administration -> SELinux Management (I am using GNOME for my window manager, btw), and shutdown SELinux, and I was able to view my user directory webpage.

So, I have found out that SELinux was causing the problem. I am not sure if I want to go through and enforce a policy specifically for SELinux. I think that might be another thread, but I have found the problem!

Thank you for the help, though. It made me think in a different direction, which helped me come to this conclusion! I appreciate the help!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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