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.

Default Account for shared IP

Discussion in 'General Discussion' started by Downthe.NET, Apr 24, 2009.

  1. Downthe.NET

    Downthe.NET Member

    Joined:
    Jun 30, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    G'Day,

    Just migrated servers, everything's gone smoothly. One problem though, when I access my shared IP (173.45.94.10), it directs to one of the accounts hosted...If I remove the account, it grabs the next one in the list alphabetically and uses that as the default page.

    What I want is for it to instead show the htdocs folder from apache (which correctly displays for anythingnotassigned.downthe.net and for IP's 173.45.94.13 and 173.45.94.14 (The nameservers)

    How can I do this?

    Dave
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    For an IP address on which websites are hosted (e.g. Shared IPs), Apache will display the page of the first virtualhost in httpd.conf when the IP itself is typed into a web browser.

    However, in a cPanel/WHM environment, there is no supported method for ensuring a specific virtualhost is listed first in httpd.conf.
     
  3. servertechs

    servertechs Active Member

    Joined:
    Aug 24, 2008
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    In httpd.conf Server/VPS hostname Vitualhost entry should be first.

    For Example:

    <VirtualHost 1.1.1.1:80>
    ServerName server.example.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin example@example.com
    </VirtualHost>

    This will show cPanel apache page for shared IP.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Be careful as EasyApache will likely re-arrange the entries in httpd.conf at the very least if it is not properly distilled.
     
  5. Downthe.NET

    Downthe.NET Member

    Joined:
    Jun 30, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    This is why I asked if you could do it via WHM, as I'm sure if I manually edit it, WHM will just overwrite it again later at some point...


    [edit]

    This is from my httpd.conf, notice www.downthe.net is the FIRST entry of VirtualHosts, yet the second entry is taking precedence.


    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE US$

    <VirtualHost 173.45.94.10:80>
    ServerName novus.downthe.net
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin hosting@downthe.net
    <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
    </IfModule>
    </VirtualHost>


    # Default vhost for unbound IPs

    <VirtualHost *>
    ServerName novus.downthe.net
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin hosting@downthe.net
    <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
    </IfModule>
    </VirtualHost>

    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE US$

    <VirtualHost 173.45.94.10:80>
    ServerName xxxxx
    ServerAlias xxxxx
    DocumentRoot /home/xxxxx/public_html
    ServerAdmin webmaster@xxxxx
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/xxxxx.net combined
    CustomLog /usr/local/apache/domlogs/xxxxx.net-bytes_log "%{%s}t %I .\n$
    ## User xxxxxx # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
    suPHP_UserGroup xxxxxx
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    SuexecUserGroup xxxxxx
    </IfModule>
    </VirtualHost>
     
    #5 Downthe.NET, Apr 24, 2009
    Last edited: Apr 24, 2009
  6. thobarn

    thobarn Well-Known Member

    Joined:
    Apr 25, 2008
    Messages:
    153
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    sanctum sanctorum
    What does following output?

    Code:
    httpd -S
     
  7. Downthe.NET

    Downthe.NET Member

    Joined:
    Jun 30, 2008
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I don't want to spam this up, so I've condensed it to the first few lines (mainly for the IP in question:
    VirtualHost configuration:
    173.45.94.12:80 is a NameVirtualHost
    default server novus.downthe.net (/usr/local/apache/conf/httpd.conf:3406)
    port 80 namevhost novus.downthe.net (/usr/local/apache/conf/httpd.conf:3406)
    173.45.94.10:443 is a NameVirtualHost
    default server novus.downthe.net (/usr/local/apache/conf/httpd.conf:3406)
    port 443 namevhost novus.downthe.net (/usr/local/apache/conf/httpd.conf:3406)
    173.45.94.10:80 is a NameVirtualHost
    default server novus.downthe.net (/usr/local/apache/conf/httpd.conf:236)
    port 80 namevhost novus.downthe.net (/usr/local/apache/conf/httpd.conf:236)

    ...a lot of accounts follow....then the other IP's...then this:


    wildcard NameVirtualHosts and _default_ servers:
    *:* is a NameVirtualHost
    default server novus.downthe.net (/usr/local/apache/conf/httpd.conf:248)
    port * namevhost novus.downthe.net (/usr/local/apache/conf/httpd.conf:248)
    port * namevhost novus.downthe.net (/usr/local/apache/conf/httpd.conf:3406)
    Syntax OK
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Unfortunately, WHM does not have this functionality at this time.

    Here's a related feature request that suggests this functionality for resellers that you may wish to vote for: http://bugzilla.cpanel.net/show_bug.cgi?id=7369
     
  9. dolphyn

    dolphyn Well-Known Member

    Joined:
    Nov 27, 2001
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Maybe I'm missing something, but I don't see any problem including the desired first VirtualHost entry in one of the /usr/local/apache/conf/includes/pre_virtualhost files. It works for me. :)
     
Loading...

Share This Page