Varnish installation

Has anyone successfully installed Varnish with Interworx? I have followed the previous posts, and got it to work. It is a very positive noticeable improvement, however all SMTP mail services through qmail stop working.
So I am missing something, and wanted to know if someone had the install steps so everything works, including the mail services. Thanks in advance.

Hi hostpanda

Have you read Dave post just recently

Kudos to Dave

Many thanks


Excellent Dave, and John

thank you

Ok, so after following the newly revised steps, each domain is showing the Apache Interworx Test Page, not the true home page for each domain.
Any idea Dave, why I’m only seeing test page??


Well after a little experience using Varnish in front of Interworx, I discovered that using localhost ( is a pretty bad idea. It adds a lot of work editing domain settings, breaks SMTP and is just plain old unnecessary. I apologize if I wasted anyone’s time.

Simply change the backend host spec in the Varnish.vcl file and avoid all of those localhost shenanigans.

Note: This server has only 1 external IP. All domains share this IP.
So, this is what I now do to make this work for me. As always… YMMV


  • Use Nodeworx to change the Webserver listen port to 81
  • Use Nodeworx firewall to allow TCP 81
  • Install Varnish
  • Make Varnish listen to port 80
  • In the Varnish.vcl file make backend port 81
  • In the Varnish.vcl file make backend host match your shared external IP
  • Reboot. Everything should work. [/LIST]


  • Still getting the interworx test page rather than the domain specific home page, any ideas??

    Hi hostpanda

    I’m sorry, to help fully you would need to give more details

    I suspect though, you have not added a new virtualhost for the new port.

    Can you confirm you have added this (vi /etc/httpd/conf.d/namevirtualhost.conf). Please remember you have to leave the original in as well, so you would have similar to this


    using Dave post of port 81 (you can use any port though, as long as you make all changes to all areas)

    Restart httpd and varnish, then test

    If this is not your issue, you would need to give more details and show your config files, like varnish and vcl

    I hope that helps

    Many thanks


    John and Dave,
    Many thanks. To confirm for others, this DOES work. The last step of adding the second port to the NameVirtualHost I had to do twice. So prior to completing Dave’s modified steps, I added the second NameVirtualHost:port to the namevirtualhost.conf file. I then completed Dave’s modified steps, and restarted varnish and httpd, which reverted namevirtualhost.conf to its original state, which did not include my modifications. So if you plan on adding varnish to your server or vps, please follow Dave’s AWESOME modified steps, restart varnish & httpd, then edit the namevirtualhost.conf and add the second entry with the new port. Restart varnish and httpd, and it works !!!
    Thanks again for the great support.

    Update: The domains are working properly, but SMTP is not working again. I am not sure why the inclusion of VARNISH breaks the SMTP of Qmail. Any ideas ??
    For now, I have to revert to exclude VARNISH to get mail fully functional.
    Thanks for any suggestions.

    Hi hostpanda

    What is the error message your seeing in logs for email

    Personally, the only port varnish is looking for is port 80, therefore I would not consider it should affect email.

    Many thanks


    My apologizes, after some further research, the problem was a firewall issue blocking IP addresses from a hotel wi-fi, and a VPN connection. So far everything is still working.