Varnish are not able to run on non default port

Kernels & Hardware, configuring network, installing services

Varnish are not able to run on non default port

Postby pascal7 » 2015-10-09 22:17

On this moment i build an webenvironment with wordpress, apache2, debian 8. On this moment i try to impelement Varnish.
By default this application use the port 6081. I try to put apache on port 8080. This already works but i get varnish not running on port 80.
You can see below that varnish still listen to the default port 6081. How can i fix this?

Code: Select all
root@webI:/home/beheerder# netstat -lpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 *:ssh                   *:*                     LISTEN      2917/sshd
tcp        0      0 *:6081                  *:*                     LISTEN      3717/varnishd
tcp        0      0 localhost:6082          *:*                     LISTEN      3699/varnishd
tcp        0      0 localhost:mysql         *:*                     LISTEN      913/mysqld
tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN      3628/apache2
tcp6       0      0 [::]:ftp                [::]:*                  LISTEN      433/vsftpd
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      2917/sshd
tcp6       0      0 [::]:6081               [::]:*                  LISTEN      3717/varnishd
tcp6       0      0 localhost:6082          [::]:*                  LISTEN      3699/varnishd

To test another port i have also try to start Varnish on port 85.
Code: Select all
vim /etc/default/varnish
DAEMON_OPTS="-a :85 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,256m"

I have restart the apache and varnish services. I have also rebooted the server but varnish will not listen on port 80 (or other non default ports).
On port 6081 the application works fine. But how can i fix this :? ?
Source Varnish port 80
I can use the application with the following command
Code: Select all
varnishd -f /etc/varnish/default.vcl -a
But why is this not working with the normal config file. Varnish are than listen to port 80.
With every server reboot i need than to run this command. So i would like to use the config file.
Posts: 1
Joined: 2015-10-09 22:06

Return to System configuration

Who is online

Users browsing this forum: No registered users and 11 guests