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.

Multiple IPs for VirtualHost

Discussion in 'General Discussion' started by alexandz, Oct 26, 2012.

  1. alexandz

    alexandz Well-Known Member

    Joined:
    Oct 28, 2011
    Messages:
    111
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Chile
    cPanel Access Level:
    Root Administrator
    Hello!

    My server uses the public IP xxx.xxx.xxx.xxx, but then I have an internal IP for VPN xx.xxx.xx.x
    - Try adding *: 80 in httpd.conf, but it did not work
    - Then try to add the same virtualhost with different IP, as below:
    "If your Apache configuration" httpd.conf "file already has an entry similar to One of These then It Should Only Be Necessary to add the One That does not yet exist (copying and pasting preferrably the existing default virtual host and only changing the IP address) "

    code:
    <VirtualHost 10.0.0.27:80>
    **************** ServerName server.domain.tld
    **************** DocumentRoot / usr / local / apache / htdocs
    **************** ServerAdmin root@server.domain.tld
    </ VirtualHost>

    <VirtualHost 10.0.0.33:80>
    **************** ServerName server.domain.tld
    **************** DocumentRoot / usr / local / apache / htdocs
    **************** ServerAdmin root@server.domain.tld
    </ VirtualHost>
    But this did not work either.

    If someone could help me, as I can have multiple IP for a virtualhost

    thanks
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    There is no way under cPanel to allow multiple IPs for a single virtualhost entry in this manner. You'll need to use /usr/local/apache/conf/includes/pre_virtualhost_global.conf to define the entries for the virtualhost and put both IPs into it:

    <VirtualHost IP1:80 IP2:80>
    the rest of the entry

    This may or may not work. As noted, this isn't something we currently support.
     
Loading...

Share This Page