How gain access to DocumentRoot contents of Apache-httpd through a Web browser which is set to point to the Home folder of the User?
Tim
ignored_mailbox at yahoo.com.au
Sat Apr 16 12:12:57 UTC 2011
On Thu, 2011-04-14 at 15:59 +0530, Varuna Seneviratna wrote:
> 1. enable the UserDir entry: "UserDir enable"
>
> 2. uncommment the next UserDIR line (and/or modify it for your
> choice): "UserDir public_html
>
> 3.Set the SELinux boolean control "httpd_enable_homedirs" to "on" to
> allow apache to access the users "public_html" (or whatever you called
> it).
>
Which are so that requests to your website *with* your username, will
server pages served from there.
i.e. http://localhost/~varuna would serve files
from /home/varuna/public_html/
Requests for just the hostname, still use the global server directory.
i.e. http://localhost/ would serve files from /var/www/html
unless you've changed the DocumentRoot directive.
How did you set step 3 of your instructions? I'm wondering whether it's
actually been applied.
> 4. Let the user create their "public_html" directory in their home
> directory, then use "chcon -t httpd_user_content_t public_html" to set
> the security label.
>
> 5. Let the user set permission bits (chmod +rx public_html) on the
> directory.
And, do (almost) the same to the files inside your public_html directory
(you don't, normally, want the files executable).
> Before Doing the above I was not able to even start httpd.But now it
> starts and the problem now is I am getting a Forbidden page?From what
> I gather I think is that httpd is able to access
> /home/varuna/public_html/ But the Web Browser is not able to access
> the Home Directory contents, public_html contents to be exact
Other things to check for: Go through your main httpd.conf file, and
any separate personal-user.conf files, if you have them. There are file
access rules set inside Directory clauses for the main DocumentRoot and
personal home spaces.
With your errors, were you trying a default file, or requesting a
specific page?
e.g. http://localhost/~varuna/ or http://localhost/~varuna/test.html
You certainly are trying out all the bells and whistles, I hope you're
having fun.
--
[tim at localhost ~]$ uname -r
2.6.27.25-78.2.56.fc9.i686
Don't send private replies to my address, the mailbox is ignored. I
read messages from the public lists.
More information about the users
mailing list