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 have configured Apache to use the UserDir part so I can create users on

http://ip.add.re.ss/~username/ where this refers to /home/username/public_html

The problem is,when I go to the above URL, I get a 403 forbidden.

I have given the /home/username/public_html folder to be writable to check, but I cannot see why this would be forbidden.

Am i missing anything possibly in Apache or user permissions?

Thanks

share|improve this question

2 Answers 2

/home/username should be "executable" by the apache process, the executable bit allows to change to that directory. /home/username/public_html and all below should be readable and executable by the apache process. It should not be writable unless there is an application specific need.

So this should do the trick:

chmod a+x /home/username
chmod -R a+rx /home/username/public_html

Try specifying full url to the file, for example: http://ip.add.re.ss/~username/mydoc.html Otherwise you willbe relying on default index. Also if you are using SELinux you may be having trouble with its restrictions, do a quick test changing it to permisive:

http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html

share|improve this answer
    
That still gives me a 403 forbidden. –  terrid25 Sep 1 '11 at 11:12
    
Ok, I have changed to permissive and i have added an index.php file. I am still getting a 403 forbidden; You don't have permission to access /~username/index.php on this server. I've even tried to set it disabled in the SELinux config –  terrid25 Sep 1 '11 at 12:30
    
Could you please post UserDir relative config extract and ls -ldF {/home,/home/username,/home/username/public_html,/home/username/public_html/inde‌​x.php} ? Also, does error_log say anything relevant ? –  Ochoto Sep 1 '11 at 12:45

Ok, so it looked like: chcon -R -t httpd_sys_content_t /home/username* seemed to do the trick and it is now accessible!

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.