Who should be the owner and group of what directories?

Discussion in 'Apache' started by RichardAlan, Aug 27, 2008.

  1. #1
    Hello,

    I'm very new to setting up Apache and now also setting up mediawiki. I have the following directory structure but I think it's wrong that root should own everything. Can someone out there tell me who should be the owner and the group and how can I go and make the changes.

    [root@ns etc]# cd /var
    [root@ns var]# ll
    total 68
    drwxr-xr-x 6 root root 4096 Aug 25 22:39 cache
    drwxr-xr-x 3 root root 4096 Dec 29 2007 db
    drwxr-xr-x 3 root root 4096 Dec 29 2007 empty
    drwxr-xr-x 2 root root 4096 Mar 29 2007 games
    drwxr-xr-x 13 root root 4096 Aug 25 22:39 lib
    drwxr-xr-x 2 root root 4096 Mar 29 2007 local
    drwxrwxr-x 4 root lock 4096 Dec 29 2007 lock
    drwxr-xr-x 5 root root 4096 Aug 26 00:50 log
    lrwxrwxrwx 1 root root 10 Dec 29 2007 mail -> spool/mail
    drwxr-x--- 5 root named 4096 Dec 29 2007 named
    drwxr-xr-x 2 root root 4096 Mar 29 2007 nis
    drwxr-xr-x 2 root root 4096 Mar 29 2007 opt
    drwxr-xr-x 2 root root 4096 Mar 29 2007 preserve
    drwxr-xr-x 12 root root 4096 Aug 27 06:09 run
    drwxr-xr-x 11 root root 4096 Aug 23 23:10 spool
    drwxrwxrwt 2 root root 4096 Aug 27 04:44 tmp
    drwxr-xr-x 6 root root 4096 Jan 15 2008 www
    drwxr-xr-x 2 root root 4096 Mar 29 2007 yp
    [root@ns var]# cd www
    [root@ns www]# ll
    total 16
    drwxr-xr-x 3 root root 4096 Aug 23 23:10 cgi-bin
    drwxr-xr-x 3 root root 4096 Feb 14 2008 error
    drwxr-xr-x 3 root root 4096 Aug 27 05:00 html
    drwxr-xr-x 3 root root 4096 Feb 14 2008 icons

    [root@ns www]# cd html
    [root@ns html]# ll
    total 4
    drwxr-xr-x 5 root root 4096 Aug 27 06:49 ac
    [root@ns html]# cd a*
    [root@ns ac]# ll
    total 16
    drwxr-xr-x 2 root root 4096 Aug 27 05:09 cgi-bin
    -rw-r--r-- 1 root root 450 Aug 27 06:45 index_blank.htm
    drwxr-xr-x 4 root root 4096 Aug 27 05:09 logs
    drwxr-xr-x 16 1000 1000 4096 Aug 14 09:39 wiki


    Thanks in advance
     
    RichardAlan, Aug 27, 2008 IP
  2. nimhost

    nimhost Active Member

    Messages:
    235
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    for apache should be running as nobody both as user and group :)
    do not run apache as root user cause will compromise your server
     
    nimhost, Aug 27, 2008 IP