Author Topic: Varnish 7 Installation & Configuration  (Read 110 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Varnish 7 Installation & Configuration
« on: April 09, 2025, 02:21:25 PM »
Has anyone successfully installed Varnish 7 on CWP yet?

I've tried a couple of times now but still get 503 when testing. Has anyone figured out the correct changes for the varnish.service file?

Offline
***
Re: Varnish 7 Installation & Configuration
« Reply #1 on: April 10, 2025, 01:18:09 AM »
Has anyone successfully installed Varnish 7 on CWP yet?

I've tried a couple of times now but still get 503 when testing. Has anyone figured out the correct changes for the varnish.service file?

Yes.
You already install it?

After install, you need to change the line in file '/usr/lib/systemd/system/varnish.service' of default installation, from:
Code: [Select]
ExecStart=/usr/sbin/varnishd -a :6081 -f /etc/varnish/default.vcl -s malloc,256m
to:
Code: [Select]
ExecStart=/usr/sbin/varnishd -a :82 -f /etc/varnish/default.vcl -s malloc,256m
After that, run:
Code: [Select]
# systemctl daemon-reload

Offline
*
Re: Varnish 7 Installation & Configuration
« Reply #2 on: April 10, 2025, 10:14:03 PM »
Ok fantastic. I'll give it another go tonight.

Thanks for taking the time to explain it. I was going crazy.

SS

Offline
*
Re: Varnish 7 Installation & Configuration
« Reply #3 on: April 11, 2025, 12:39:05 AM »
Has anyone successfully installed Varnish 7 on CWP yet?

I've tried a couple of times now but still get 503 when testing. Has anyone figured out the correct changes for the varnish.service file?

Yes.
You already install it?

After install, you need to change the line in file '/usr/lib/systemd/system/varnish.service' of default installation, from:
Code: [Select]
ExecStart=/usr/sbin/varnishd -a :6081 -f /etc/varnish/default.vcl -s malloc,256m
to:
Code: [Select]
ExecStart=/usr/sbin/varnishd -a :82 -f /etc/varnish/default.vcl -s malloc,256m
After that, run:
Code: [Select]
# systemctl daemon-reload


I ended up getting it running but at least in v7.7 it's slightly different

Here is the original varnish.service file

Code: [Select]
ExecStart=/usr/sbin/varnishd \
          -a :6081 \
          -a localhost:8443,PROXY \
          -f /etc/varnish/default.vcl \
          -P %t/%N/varnishd.pid \
          -p feature=+http2 \
          -s malloc,256m

it seems if you change it as below it works (changing the port to 82 and proxy port to 8444 - conflicts with httpd on 8443)

Code: [Select]
ExecStart=/usr/sbin/varnishd \
          -a :82 \
          -a localhost:8444,PROXY \
          -f /etc/varnish/default.vcl \
          -P %t/%N/varnishd.pid \
          -p feature=+http2 \
          -s malloc,256m


then run


Code: [Select]
systemctl daemon-reload
systemctl enable varnish
systemctl status varnish

After confirmed running you need to go to CWP and rebuild the webservers in CWP in order to generate the conf files.

Thanks again to Netino for pointing this out!