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 same site, vhost template dosen't applay in httpd.conf

Discussion in 'Workarounds and Optimization' started by tbogdan, Mar 17, 2012.

  1. tbogdan

    tbogdan Registered

    Joined:
    Mar 17, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I want to configure second ip for all websites in order to load balancing and backup.
    I have 2 wlan, from 2 distinct isps.
    First I use for usual hosting, and second I user for load balancind and backup.

    Dns settings are easy, I can edit dns zone template from whm, in there I put something like this:
    %domain%. IN A %ip% - 1st isp
    %domain%. IN A xxx.xxx.xxx.xxx - 2nd isp

    But when I have edit apache template after rebuild configuration vhost template dosen't aplay.

    I was doing this:

    in /var/cpanel/templates/apache2/
    copy vhost.default to vhost.local
    copy ssl_vhost.default to ssl_vhost.local

    edit in bouth:
    replace <VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:[% ipblock.port %][% END %]>
    to <VirtualHost \
    [% FOREACH ipblock IN vhost.ips %][% ipblock.ip %]:[% ipblock.port %][% END %]\
    xxx.xxx.xxx.xxx:80\
    >
    - port 80 in vhost.local or 443 in ssl_vhost.local

    after thar I have rebuild the apache httpd.conf:
    -bash-3.2# /scripts/rebuildhttpdconf
    info [rebuildhttpdconf] 'local' datastore in use (/var/cpanel/conf/apache/local)
    Built /usr/local/apache/conf/httpd.conf OK

    And I expected in httpd.conf somthing like this:
    <VirtualHost \
    xxx.xxx.xxx.xxx:80\ - 1st ips
    xxx.xxx.xxx.xxx:80\ - 2nd isp
    >

    But httpd.conf was buid with default VirtualHost directive:
    <VirtualHost xxx.xxx.xxx.xxx:80> - 1st isp only

    Also, I have try to doble the VirtualHost template, in second vhost I have put second ip like:
    Default:
    __
    <VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:[% ipblock.port %][% END %]>
    ...
    </VirtualHost>
    __


    New:
    __
    <VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:[% ipblock.port %][% END %]>
    ...
    </VirtualHost>

    <VirtualHost xxx.xxx.xxx.xxx:80>
    </VirtualHost>
    __

    No changes in httpd.conf after rebuild, same result....

    Please help me, what is wrong in what I am doing?

    PS: sorry for my English.
     
Loading...

Share This Page