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 & ~ linking through servername

Discussion in 'EasyApache' started by GypsyMage, Nov 29, 2004.

  1. GypsyMage

    GypsyMage Member

    Joined:
    Apr 27, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    I have a user that is linking to his home directory through the main server name. Therefore, cpanel isn't logging the used bandwith to his account, rather to the server name's log file.

    Example.

    Instead of:
    http://www.hisdomain.com/file.jpg

    He uses:
    http://servername.com/~hisusername/file.jpg

    I'm looking for a way to disable ~ linking for this client. Either by disabling userdir.mod or some flag in httpd that I don't know about. I'd rather leave the userdir mod on, but disable it for just this one client. Thoughts??
     
    #1 GypsyMage, Nov 29, 2004
    Last edited: Nov 29, 2004
  2. Renjith Rajan

    Renjith Rajan Member

    Joined:
    Aug 22, 2004
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I am late..but i think it is good to post my idea.....

    Suppose your server name is server.yourhost.com and the main shared ip is 192.168.1.7 ..open httpd.conf and find out the virtual host entry for your server name..It will look something like this...

    <VirtualHost 192.168.1.7>
    BytesLog domlogs/server.yourhost.com-bytes_log
    ServerName server.yourhost.com
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>


    And if you want to block the user123 from using ~user123, just put the following line in the above virtual host and restart apache....

    UserDir disabled user123

    So the resulting virutal host is....

    <VirtualHost 192.168.1.7>
    BytesLog domlogs/server.yourhost.com-bytes_log
    ServerName server.yourhost.com
    UserDir disabled user123
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>


    :p
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Or - you could just use the mod_userdir feature in WHM > Tweak Security ;)
     
  4. cemlouis

    cemlouis Member

    Joined:
    Oct 27, 2005
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    After enabling tweak security http://0.0.0.0/~useraccount gives a 404

    How can I make this work?
     
Loading...

Share This Page