While Apache Listing to Port 8080 - Website is Not Working

March 2, 2015 3.9k views

I have successfully installed varnish cache on Cpanel + Centos 6.5 + Apache. While I changed the Apache port from 80 to 8080, my website stop functioning. However, While I switch back to default Port 80 then Website start responding. Varnish cache is installed and listing to port 80.

I did below mention steps to install varnish.

yum install -y gcc make automake autoconf libtool ncurses-devel libxslt groff pcre-devel pckgconfig libedit libedit-devel

rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release/varnish-release-3.0-1.el6.noarch.rpm

yum install varnish

Please help me on this.

1 comment
3 Answers

Sounds like iptables. What does "iptables -L" return. Probably port 80 is open but port 8080 is not.

Did you configure varnish to use localhost:8080 as backend?

also remember to restart both services after changing the config files.

My Setting is

 nano -w /etc/sysconfig/varnish
Not setting VARNISHLISTENADDRESS makes Varnish listen on all IPs on this box (Both IPv4 and IPv6 if available). Set manually to override this. VARNISHLISTENADDRESS=

VARNISHLISTENPORT=80

Telnet admin interface listen address and port

VARNISHADMINLISTENADDRESS=127.0.0.1
VARNISH
ADMINLISTENPORT=6082

nano -w /etc/varnish/default.vcl

backend default {
.host = "127.0.0.1";
.port = "8080";
}

I am using apache 2.4 php 5.5 cpanel centos 6.5 64X

What i have to do next

  • On my server, I got memcached, varnish, cpanel, apache 2.4 and php 5.5 on centos 6.5 x65. I want to run WordPress website, which is a migration from hostgator.

    Please help me, I would make apache to listen 8080 port to work varnish cache.

  • Do you mean VARNISH_LISTEN_PORT=80 ?
    it is apache bind to localhost on port 80 or you setup an IP address for it, like your public ip?

    Paste your full configuration of both varnish and apache, it will be easier to diagnose. I don't know why people is SO scared to share config files, just mask ip address

Have another answer? Share your knowledge.