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.

mod userdir bug???

Discussion in 'General Discussion' started by nazmy, Apr 20, 2005.

  1. nazmy

    nazmy Member

    Joined:
    Oct 31, 2004
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    well mod userdir protection causes some conflict

    NameVirtualHost X.X.X.X:80

    <VirtualHost X.X.X.X>
    ServerAlias www.domain.com domain.com
    ServerAdmin webmaster@domain.com
    DocumentRoot /home/user1/public_html
    BytesLog domlogs/domain.com-bytes_log
    User user1
    Group user1
    <IfModule mod_php4.c>
    php_admin_value
    open_basedir "/home/user1/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_userdir.c>
    UserDir disabled
    UserDir enabled user1
    </IfModule>
    ServerName www.domain.com
    ScriptAlias /cgi-bin/ /home/user1/public_html/cgi-bin/
    User user1
    Group user1
    CustomLog domlogs/domain.com combined
    </VirtualHost>


    <VirtualHost X.X.X.X>
    ServerAlias www.anotherdomain.com anotherdomain.com
    ServerAdmin webmaster@anotherdomain.com
    DocumentRoot //home/user2/public_html
    BytesLog domlogs/anotherdomain.com-bytes_log
    User user2
    Group user2
    <IfModule mod_php4.c>
    php_admin_value
    open_basedir "//home/user2/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_userdir.c>
    UserDir disabled
    UserDir enabled user2
    </IfModule>
    ServerName www.anotherdomain.com
    ScriptAlias /cgi-bin/ //home/user2/public_html/cgi-bin/
    User user2
    Group user2
    CustomLog domlogs/anotherdomain.com combined
    </VirtualHost>


    but this causes calls to http://X.X.X.X/~user2

    to go to http://X.X.X.X/user1/public_html/~user2

    ofcourse user1 is the first virtual host using this ip
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Probably because you've forgotten to put a trailing slash on the end of the URL - I've never seen what you're reporting when using the url correctly, i.e. http://11.22.33.44/~username/
     
  3. nazmy

    nazmy Member

    Joined:
    Oct 31, 2004
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    well chirpy ofcourse i tried putting a trailing slash it didnt work also i checked the httpd.conf with other servers i got it looked the same

    and this problem is server wide when i turn mod_userdir protection off everything is ok

    but when mod_userdir protection is on i cant use http://11.22.33.44/~username/

    and error_log reads

    Code:
    [Wed Apr 20 20:03:30 2005] [error] [client 81.10.18.244] File does not exist: /home/user1/public_html/~user2/
    
    
    and i get a 404 error on the browser screen

    this happenes on all ips the first account set to an ip in httpd.conf takes the calls

    although on other servers it works fine
     
    #3 nazmy, Apr 20, 2005
    Last edited: Apr 21, 2005
Loading...

Share This Page