Varnish + ISPConfig

Discussion in 'Installation/Configuration' started by Mario90, May 24, 2014.

  1. Mario90

    Mario90 New Member

    Hi,
    i would like to set up ISPConfig to work with varnish cache.
    I believe that for each .vhost file it should set <VirtualHost 127.0.0.1:8080> to let Varnish work.
    Is there a way to this automatically? Is there a guide for the correct configuration?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Just edit the ispconfig vhost template file and store your custom template in the conf-custom folder.
     
  3. maumar

    maumar New Member HowtoForge Supporter

    Till sorry for lamerness, blame on me...
    which is the "ispconfig vhost template file" ?

    I did
    Code:
    find /usr/local/ispconfig -name "*vhost*"
    
    but I am not able to find it
     
  4. maumar

    maumar New Member HowtoForge Supporter

    if this is the file

    Code:
    ./server/conf/apache_ispconfig.conf.master
    
    then looking at the bottom of it:

    Code:
    NameVirtualHost *:80
    NameVirtualHost *:443
    <tmpl_loop name="ip_adresses">
    NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
    </tmpl_loop>
    
    
    if have to copy this file in ./server/conf-custom/

    and in this copy of original I change *:80 with *:8080 (if now apache is listening on port is 8080 as varnish backend )
     
  5. maumar

    maumar New Member HowtoForge Supporter

    or better this one
    /usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php

    Code:
    
    grep 80\)  /usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php
                    $tmp_vhost_arr = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 0, 'port' => 80);
                            $tmp_vhost_arr = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 0, 'port' => 80);
                            $apache_online_status_before_restart = $this->_checkTcp('localhost',80);
                                    $apache_online_status_after_restart = $this->_checkTcp('localhost',80);
    
    
    copy to custom-conf and change 80 with 8080

    I'll try :)
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    there are no code changes in ispconfig required. you can do all nescssary changes by altering the template files and storing the templates in conf-custom. by changing the code like you suggested in #5, you will loose the ability to install ispconfig updates.
     
  7. maumar

    maumar New Member HowtoForge Supporter

    Till
    I agree with you, but please point me to the correct template file to be copied on custom-conf and there I can change port 80 with port 8080 as requested by a standard varnish installation


    many thnx :)
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The template file is named vhost.conf.master
     
  9. maumar

    maumar New Member HowtoForge Supporter

    now it is working fine.
    I have created a new virtualhost and it has port 8080 like requested.
    many thnx
     

Share This Page