httpd vhosts stupid question :)

Discussion in 'General' started by /<2, Apr 23, 2010.

  1. /<2

    /<2 New Member

    Greetings!

    my principal domain is "beta.com". My problem is that, when I go to my server IP, shows my secundary domain "alpha.com".
    How I can change the _default_ vhost server "alpha.com" to "beta.com"???

    Code:
    [root@vm /]# httpd -S
    VirtualHost configuration:
    wildcard NameVirtualHosts and _default_ servers:
    *:8080                 is a NameVirtualHost
             default server vm.beta.com (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
             port 8080 namevhost vm.beta.com (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
    *:443                  is a NameVirtualHost
             default server vm.beta.com (/etc/httpd/conf.d/ssl.conf:81)
             port 443 namevhost vm.beta.com (/etc/httpd/conf.d/ssl.conf:81)
    *:80                   is a NameVirtualHost
             default server alpha.com (/etc/httpd/conf/sites-enabled/alpha.com.vhost:7)
             port 80 namevhost alpha.com (/etc/httpd/conf/sites-enabled/alpha.com.vhost:7)
             port 80 namevhost beta.com (/etc/httpd/conf/sites-enabled/beta.com.vhost:7)
             port 80 namevhost charlie.com (/etc/httpd/conf/sites-enabled/charlie.com.vhost:7)
             port 80 namevhost delta.com (/etc/httpd/conf/sites-enabled/delta.com.vhost:7)
             port 80 namevhost echo.com (/etc/httpd/conf/sites-enabled/echo.com.vhost:7)
    Syntax OK
    [root@vm /]# 
    httpd-S displays the list in alphabetical order. Does this have something to do?
    Or is the web traffic that determines the order of default server? "Alpha.com" is the one with more traffic.

    Thanks!
     
    Last edited: Apr 23, 2010
  2. /<2

    /<2 New Member

    Solution

    yes :) the vhosts set the default for alphabetical name. Sorry for the stupid question, my brain are slow lately.
    If anyone has the same problem, do this:

    Go to /etc/httpd/conf/sites-enabled/
    Rename the alias domain you want to take as default server *.80 and set it before "001-"

    In my case, I rename "beta.com.vhost" alias to "001-beta.com.vhost"

    Restart apache: /etc/init.d/httpd restart

    And try now with your server IP. Now point to beta.com :D

    Thanks also!
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    When you change the website the next time, then ispconfig will add the same website a second time as the origional vhost file does not exist anymore.

    If you want to have a default vhost for a specific IP address, please take a look here:

    http://httpd.apache.org/docs/2.0/vhosts/examples.html
     
  4. /<2

    /<2 New Member

    before my sloppy work solution, I tried to do these apache examples.
    I did not get worked. Vhosts and me, we do not understand :D
    I will continue investigating...

    Till thanks for the help!
     

Share This Page