Re: Problems with UserDir directive on CentOS 5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Niki,

On Sun, 2007-06-10 at 12:17 +0200, Niki Kovacs wrote:
> I open Firefox at http://localhost/~kikinovak/
> 
> ... and I get the following error message:
> 
> Forbidden
> 
> You don't have permission to access /~kikinovak/ on this server.
> Apache/2.2.3 (CentOS) Server at localhost Port 80
> 
> Q: what did I do wrong? (I've done this successfully on Slackware and 
> Debian before)

Probably two things:

* Apache needs directory access permissions (x) on each path component
in /home/kikinovak/public_html. They are probably missing
on /home/kikinovak:

chmod +x /home/kikinovak

I'll let you think about the security implications ;).

* If you are using SELinux, you need to make sure the right context is
set for /home/kikinovak/public_html. You can see the current context
with "ls -Z", e.g.:

---
$ ls -dZ public_html
drwxrwxr-x  daniel daniel user_u:object_r:user_home_t      public_html
---

You can set the proper context (httpd_sys_content_t or
httpd_user_content_t) with chcon:

---
chcon -R -t httpd_sys_content_t public_html
---

or restorecon (since this directory should already be in the predefined
contexts):

/sbin/restorecon -R public_html

-- Daniel

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux