2 IP's for one virtual host

Discussion in 'Installation/Configuration' started by citronz, Jan 24, 2008.

  1. citronz

    citronz New Member

    Got another question. I have machine with 2 IP's, different gateways, both external - that's because hosting company will soon change there IP segment from one to another. That's all done fine for now.
    However DNS should be changed for many sites. And DNS change might be long process so therefor there is a question. Is there any valid possibility to make Vhost config file look like this:
    Code:
    <VirtualHost 123.123.11.22:80 211.211.211.22:80>
    ServerName www.domain.com:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web211/web
    ....
    </VirtualHost>
    

    Thanks
     
  2. Eppolet

    Eppolet New Member

    As stated in http://httpd.apache.org/docs/1.3/mod/core.html#virtualhost
    ...
    You can specify more than one IP address. This is useful if a machine responds to the same name on two different interfaces. For example, if you have a VirtualHost that is available to hosts on an internal (intranet) as well as external (internet) network. Example:

    <VirtualHost 192.168.1.2 204.255.176.199>
    DocumentRoot /www/docs/host.foo.com
    ServerName host.foo.com
    ServerAlias host
    </VirtualHost>

    The special name _default_ can be specified in which case this virtual host will match any IP address that is not explicitly listed in another virtual host. In the absence of any _default_ virtual host the "main" server config, consisting of all those definitions outside any VirtualHost section, is used when no match occurs.
    ...

    IMHO looks like it should work.
     
  3. citronz

    citronz New Member

    Thanks for answer.
    I know that such configuration in Apache config file will work. But in ISPconfig administration I have to choose only one IP for domain. In most cases it's all I ever need.

    All I can think of is to add additional static IP address here
    ispconfig/isp/conf/vhost.conf.master

    edit line from this
    Code:
    <VirtualHost {IP}>
    to this
    Code:
    <VirtualHost {IP} 211.211.211.22:80>
     
  4. Eppolet

    Eppolet New Member

    If {IP} is an variable containing something like "10.0.0.1:3333" then what exactly prevents making it look like "10.0.0.1:3333 192.168.0.1:8080" ?

    Quick and dirty: just delete text "{IP}" in <VirtualHost {IP}> and make it look like you need it, however it wouldn't be correct approach IMHO.
     
  5. citronz

    citronz New Member

    Im affraid that this is the only way for now. Thanks!
     

Share This Page