Default Site For IP?

Discussion in 'Installation/Configuration' started by Unfaiir, Jul 22, 2012.

  1. Unfaiir

    Unfaiir Member

    When I type in my IP address into a browser, it takes me to one of my sites. I'm sure there is a logic to which site ISPConfig 3 is picking, I think its choosing the first site I made. How can I control which site is the default site that gets shown when the IP address is typed into the browser?
  2. MaddinXx

    MaddinXx Member

    If you created name-based virtual hosts it should not point you to one of those sites.

    However, if you created IP based sites it takes you to the one which has the IP address set.

    The default site would be /etc/apache/sites-available/default and should point you to /var/www/.
  3. Unfaiir

    Unfaiir Member

    I just have all of my sites created with *:80, its just easier that way and assigning IPs was giving me issues with sites loading.

    I don't have a default in my /etc/httpd/conf/sites-available, just the files created by ISPConfig 3 in there.

    I can always resort to checking the %{HTTP_HOST} in a RewriteCond at the site that the IP leads to, but that doesn't seem very elegant. There must be a better way.
  4. Unfaiir

    Unfaiir Member

    Still having issue

    So I'm still having this issue to this day.

    Whenever I enter a non-existent subdomain for any site, or if I enter the server IP, it brings me to a certain site on my server. I have no idea how ISPConfig has chosen the default site that it has chosen to use in these cases. This WOULD be fine, but ONLY if I can control what site it brings me to.

    I've tried using /var/www/html, but that location never gets accessed.

    Does anyone know how to change what default site ISPConfig 3 brings you to when you enter a non-existent sub-domain for a site or just enter in the IP for the server?
    Last edited: Sep 20, 2012
  5. Unfaiir

    Unfaiir Member


    I looked into how my sites were setup in ISPConfig 3 and they were all set to use * as the IP. One by one I went in and set them to the server IP instead of * in ISPConfig.

    I noticed two interesting things. First, when I set any site to use the server IP instead of *, it would no longer work. Second, whenever I set whatever site was acting as the "default site" to not use * as the IP, another site that still was using * as the IP would become the new "default site". It seems as though the most recent site that was setup in ISPConfig 3 to use * as the IP will become the "default site". This is bad, I need to control which site is the "default site", not let the "most recent * IP site" become the new goto "default site" for all non-existent sub domains or by directly entering the site IP into the browser.

    After all sites were no longer using * as the IP, I noticed that none of my sites would load and that /var/www/html was now being used as the "default site".

    Ok.. what is going on here? To me it seems like some kind of IP configuration issue. So I go into my /var/www/html and drop in a phpinfo(); and take a look.

    I noticed that when I scroll down to Apache vars and i see my servers internal IP address instead of my servers public IP address. My server is behind a router which routes all incoming traffic to the server on a static internal IP:

    I believe I see what is happening here. I set ISPConfig to have the sites use my servers public IP address, however, here is my internal IP address being used by Apache. Something is a miss here in IP land and I'm not sure exactly what it is or how to fix it.

    Does anyone know how to configure this router/server/IP situation to work correctly with ISPConfig? It seems I must have done something wrong with the IP configuration or forgot something, but I don't see what yet.

    My server is behind a router, which then assigns the server an internal static IP of I need ISPConfig to let the public IP be the ONLY choosable IP in the drop down when setting up a site though. I don't want to show up in the drop down at all for anyone to choose as their IP.

    My goal is to let a client of mine use this system too for their site and I don't want to allow them or make them choose the server's internal IP if I don't have to. In fact, I'd rather they not be able to use * either because it seems like whatever site is the "LAST" site to enter * as their IP becomes the latest and greatest "default site" for the server according to ISPConfig. I don't want my client to become the default site just because she used * as her site IP after me.

    Can anyone help?
    Last edited: Sep 20, 2012
  6. Unfaiir

    Unfaiir Member

    Fresh Install, Same Problem...

    I've done a fresh install and still have this issue.

    What I Expect To Happen:
    I want to throw a 404 error as it should when the subdomain blah doesn't exist for

    What Actually Happens:
    If is not a valid subdomain, the client is redirected to the first domain on the server it finds (bottom up) that has autosubdomain set to *..

    Why This Is Bad:
    1.) Client#1 creates a site: and sets autosubdomain to *.
    2.) Client#2 creates a site: and sets autosubdomain to www.
    3.) Patron#1 while trying to view, accidently types and instead goes to Client#1's site of
    4.) Patron#1 calls Client#2 (who knows absolutely nothing about computers) and says, your site has been hijacked! Call your hosting provider immediately!
    5.) Client#2 calls ME and cusses me out saying WTF am I paying you for, you let my site get hiijacked!? You have the worst service ever! I KNOW where you live and I don't handle things through the police! (True story BTW)

    Help Please? :confused:

Share This Page