Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Apr 2011
    Posts
    14

    Default using default domain when visiting direct IP instead of host name?

    Suppose I have a dedicated IP 1.2.3.4 for my VPS, and default domain name "example.com".

    I also have some addon domains, which resolve to the same IP. When browsing to either the main domain name or an addon domain, Apache and/or cPanel (not sure which?) will be able to tell which site (i.e. which document root) to use, depening on the host/domain name I used in the URL.

    However, if I browse directly to the IP, e.g. http://1.2.3.4/ I get the default "Apache is working on your cPanel® and WHM™ Server" page.

    Can I somehow configure things so that users visiting http://1.2.3.4/ are getting the site for the default domain? (that is, the same as www.example.com, rather than the default cpanel/apache page)

    Note: I don't necessarily mean redirect them to www.example.com (although that would be OK as well), but I mean actually getting the main site by its IP (instead of the domain name it resolves to).

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: using default domain when visiting direct IP instead of host name?

    A dedicated IP would generally function on the first site listed under that IP in httpd.conf for the VirtualHost entry. The only times this isn't the case are when a) the shared IP is being used which has the document root for /usr/local/apache/htdocs location, or b) the IP isn't bound to the machine and so any unbound IPs will default to /usr/local/apache/htdocs location.

    If your dedicated IP is not showing the first site listed with that IP in /usr/local/apache/conf/httpd.conf file, then please open up a ticket for us to troubleshoot further. You may open up a ticket using WHM > Support Center > Contact cPanel or via the link in my signature.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. 500 Internal Server Error when visiting domain.ext/cpanel, whm
    By nixgurus in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-17-2011, 07:42 AM
  2. Data Host Direct LLC ONE YEAR ANNIVERSARY 75% OFF!
    By DHD-Nick in forum VPS Servers
    Replies: 0
    Last Post: 08-15-2009, 03:01 AM
  3. How to direct my domain
    By season in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 06-23-2009, 09:32 AM
  4. shared ssl direct to proper domain
    By zortslowski in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-31-2008, 09:25 PM
  5. A domain appears when visiting hostname url
    By elevenx in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-03-2008, 01:57 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube