The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache 2.x Problem

Discussion in 'EasyApache' started by dravenlon, Jan 11, 2007.

  1. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    First off I would like to say I am pretty new to linux, WHM/CPanel, and updating apache.

    Now that is said, here is what I did...


    I went into WHM and updating it to Edge, then I went and clicked "Apache Update" and updated from 1.3.37 to 2.2.3 with gd+freetype support. What a mistake this was! :D

    I ended up getting the following while PHP 5 was compiling...

    Code:
    Error: postcheck() returned a failed status
    Restoring previously working apache
    and of course, my httpd kept failing, all day. So I ended up backing up the /usr/local/apache directory and deleted it and then I ran /scripts/easyapache to start over. When I start httpd I get...

    Code:
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 216.32.88.234:0 overlaps with VirtualHost 216.32.88.234:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 216.32.88.234:0 overlaps with VirtualHost 216.32.88.234:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 66.199.235.170:0 overlaps with VirtualHost 66.199.235.170:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 66.199.235.170:0 overlaps with VirtualHost 66.199.235.170:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 216.32.88.234:0 overlaps with VirtualHost 216.32.88.234:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 66.199.235.170:0 overlaps with VirtualHost 66.199.235.170:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 216.32.88.234:0 overlaps with VirtualHost 216.32.88.234:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 216.32.88.234:0 overlaps with VirtualHost 216.32.88.234:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 216.32.88.234:0 overlaps with VirtualHost 216.32.88.234:0, the first has precedence, perhaps you need a NameVirtualHost directive
    [Thu Jan 11 01:36:46 2007] [warn] VirtualHost 66.199.235.170:0 overlaps with VirtualHost 66.199.235.170:0, the first has precedence, perhaps you need a NameVirtualHost directive
    
    and all my sites have a 403 Forbidden error now. And for some reason I have a /usr/local/apache directory AND a /usr/local/apache2_2 directory after I ran /scripts/easyapache

    If I comment out all the VirtualHosts at the end of httpd.conf then I no longer get the "warnings" above. However, I don't think they are supposed to be commented :) And my sites still get a 403 Forbidden error

    Any help would be much appreciated. thank you
     
    #1 dravenlon, Jan 11, 2007
    Last edited: Jan 11, 2007
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    As for the 403 errors, check the owner/group and permissions of a user's /home/user/public_html directory. If the Apache user (nobody) cannot read that directory, then you would have the 403 errors. That's actually a problem with the current EDGE build when you have FrontPage extensions enabled, but you might experience it in other circumstances.

    As for the apache2_2 and apache directories, that is how the new easyapache functions. Which version of apache you build is placed into /usr/local/apacheM_M and the appropriate files are copied (or symlinked for some directoies) to /usr/local/apache

    If you still have a backup httpd.conf that worked previosuly, try copying it to /usr/local/apache/conf/
     
  3. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    okay thank you. Now, what should the permissions, group/owner be?


    I did...

    Code:
    chmod 755 /home
    chmod 755 /home/user
    chown nobody:nobody /home
    chown nobody:nobody /home/user
    
    that correct?
     
    #3 dravenlon, Jan 11, 2007
    Last edited: Jan 11, 2007
  4. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    I still haven't been able to fix this. Anyone know how I can fix it?
     
  5. mOdY

    mOdY Well-Known Member

    Joined:
    Dec 25, 2004
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    If i understand cpanelkenneth right, then i think this would fix your problem in a shake of a lamb's tail :)


    #!/bin/bash
    cd /var/cpanel/users
    for user in *
    do
    chown $user:nobody ""/home"/"$user"/public_html/"
    done

    #end#


    Steps:-
    1. Paste the bash script above in a new file.
    2. chmod 700 filename.sh
    3. ./filename.sh
    -- assuming that filename.sh if the file you pasted the script in.
     
  6. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA


    I made filename.sh in the / directory and ran it. it didn't fix the problem. my site is http://www.landofnevard.com
     
  7. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    Still didn't work.. the commands I did are...

    Code:
    chmod 750 /home/user/public_html
    chown nobody:nobody /home/user/public_html
    
     
  8. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    the "public_html" folder should be chmod'ed 0750 owned by the user and group by "nobody"

    Mickalo
     
  9. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    that should be chmod 0750

    and the chown should be the username:nobody
    where the "username" is replaced by the actual account's username IE: fred:nobody if the username is fred

    Mickalo
     
  10. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    still not working :(

    Code:
    root@server [/usr/local]# chmod 0750 /home/user/public_html/
    root@server [/usr/local]# chown user:nobody /home/user/public_html/
    
     
  11. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Ok, the problem is probably the trailing slash on your path, try removing the trailing slash at the end of the public_html/ <= (remove this slash), then run your commands again and see if this corrects it.

    Mickalo
     
  12. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    nope. It is something that the Edge apache script did. When I go back to Current WHM and run /scripts/easyapache it just tells me that httpd won't start
     
  13. HelloAdam

    HelloAdam Well-Known Member

    Joined:
    Nov 6, 2005
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Hey,

    Whats the CHMOD on the folder /home (do dir -ls) then whats the CHMOD on the folder for the user /home/USER <-- that folder.

    From,
    Adam
     
  14. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    /home/ directory...
    Code:
    8 drwx--x--x   21 nobody nobody  4096 Jan 12 19:59 home/
    
    User directory...
    Code:
    4 drwx--x--x  41 user user 4096 Jan 12 20:03 user/
    
    public_html directory..

    Code:
    12 drwxr-x---  13 user nobody        12288 Jan 10 01:32 public_html/
    
     
  15. dravenlon

    dravenlon Member

    Joined:
    Jan 11, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL, USA
    this is in /usr/local/apache/logs/error_log...

    Code:
    [Fri Jan 12 21:44:38 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/
    [Fri Jan 12 21:44:38 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/403.shtml
    [Fri Jan 12 21:44:41 2007] [error] [client 206.192.51.209] client denied by server configuration: /home/user/public_html/
    [Fri Jan 12 21:44:41 2007] [error] [client 206.192.51.209] (13)Permission denied: access to /403.shtml denied
    [Fri Jan 12 21:44:51 2007] [error] [client 69.221.56.14] client denied by server configuration: /home/user2/public_html/
    [Fri Jan 12 21:44:51 2007] [error] [client 69.221.56.14] (13)Permission denied: access to /403.shtml denied
    [Fri Jan 12 21:44:52 2007] [error] [client 69.221.56.14] client denied by server configuration: /home/user2/public_html/
    [Fri Jan 12 21:44:52 2007] [error] [client 69.221.56.14] (13)Permission denied: access to /403.shtml denied
    [Fri Jan 12 21:45:01 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/whm-server-status
    [Fri Jan 12 21:45:01 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/403.shtml
    [Fri Jan 12 21:45:03 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/whm-server-status
    [Fri Jan 12 21:45:03 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/403.shtml
    [Fri Jan 12 21:45:03 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/whm-server-status
    [Fri Jan 12 21:45:03 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/403.shtml
    [Fri Jan 12 21:45:03 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/whm-server-status
    [Fri Jan 12 21:45:03 2007] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/apache/htdocs/403.shtml
    [Fri Jan 12 21:45:11 2007] [error] [client 69.221.56.14] client denied by server configuration: /home/user2/public_html/
    [Fri Jan 12 21:45:11 2007] [error] [client 69.221.56.14] (13)Permission denied: access to /403.shtml denied
    [Fri Jan 12 21:45:11 2007] [error] [client 69.221.56.14] client denied by server configuration: /home/user2/public_html/
    [Fri Jan 12 21:45:11 2007] [error] [client 69.221.56.14] (13)Permission denied: access to /403.shtml denied
    
     
  16. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    The problem is this at /usr/local/apache/conf/httpd.conf

    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>


    Change this to :

    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
    </Directory>

    Then; restart apache.
     
  17. gammahelixx

    gammahelixx Member

    Joined:
    Sep 1, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    When this problem happened to me, it was because easyapache put in:

    Code:
    Group daemon
    in /usr/local/apache/conf/httpd.conf

    I just replaced it with

    Code:
    Group nobody
    and was good to go.
     
  18. Miss Jacky

    Miss Jacky Well-Known Member

    Joined:
    Mar 4, 2004
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Thanks gammahelixx, that looks like the best sollution and fixed this and another thing for me too.

    Anyone an idea why easyapache does this? In my httpd.conf it said
    Code:
    Group #-1
    I fixed mine by adding the 'Group nobody' line into the pre-virtual hosts include, so it will not be overwritten.

    (CentOS 5, apache 2, easyapache 3)
     
Loading...

Share This Page