Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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

    Mar 17, 2012
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    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 - 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 %]\\
    - 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 \\ - 1st ips\ - 2nd isp

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

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

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


    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.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice