You can set Varnish to connect to any port when you set your backend directive. As far as Varnish on Port 80, that is always required for a webserver, unless you want a URL that needs to specify a port (ie: http://www.example.com:81 - or whatever port you want).

Make sure you have Apache listening on port 8080 in your Apache config. You really don't need to open up that port in IPTables, since it is a local connection between Varnish and Apache, but you do need to make sure that Apache is also listening on localhost.

To make sure Apache is listening on the proper port,  go into a command line and type:

lynx localhost:8080.

That will bring up the text web browser Lynx. If it isn't installed, go ahead and install it with apt-get, yum or whatever package installer you have. All major distributions have it open. That will tell you if the webserver is actually able to connect to Apache or not.

Also make sure that Apache isn't also trying to listen on port 80. Look at the listen directive in your apache config file. So you want listen like this:

Listen 127.0.0.1:8080.

If you're using virtual hosts, make sure to specify the port in the VHost declaration:

<VirtualHost *:8080>

What you're trying to achieve is having all connections to Apache go through Varnish, as Varnish functions as a proxy server to Apache.
Jamie Holly
http://www.intoxination.net 
http://www.hollyit.net
On 3/17/2013 2:13 AM, Kamal Palei wrote:
Dear All
I am planning to use Varnish 3.0.3 with Drupal 7.15.
I hope both of these are compatible.., any input highly appreciated.

Varnish binds to two ports 6081, 6082.
I read somewhere we need to run Varnish in port 80 and apache in 8080 and accordingly we need to configure.

If I do that, I am unable to access the site. Is it required to open port 8080 in firewall.

Thanks
-Kamal