尝试在cpanel+cloudlinux VPS上安装清漆,但无法启动软件。varnish.service失败。
$varnishd -V varnishd
(varnish-6.0.8修订版97e54ada6ac578af332e52b44d2038b4fa4cd4a)版权所有(c)2006 Verdens Gang AS版权所有(c)2006-2020 Varnish软件AS
尝试启动清漆。。。
$systemctl start varnish
varnish.service的作业失败,因为控制进程退出,返回错误代码。参见";systemctl状态清漆服务";以及";日志ctl-xe";详细信息。
我的apache在端口8080上列出…
$netstat -pnltu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 656/exim
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 1272/memcached
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1275/dovecot
tcp 0 0 0.0.0.0:2095 0.0.0.0:* LISTEN 337953/cpsrvd
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 1499/perl
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1275/dovecot
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 830454/httpd
tcp 0 0 0.0.0.0:2096 0.0.0.0:* LISTEN 337953/cpsrvd
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 656/exim
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1290/pdns_server
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1276/pure-ftpd (SER
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 656/exim
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1290/pdns_server
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 830454/httpd
tcp 0 0 0.0.0.0:38908 0.0.0.0:* LISTEN 1225059/checkstatus
tcp 0 0 0.0.0.0:2077 0.0.0.0:* LISTEN 2364/cpdavd - accep
tcp 0 0 0.0.0.0:2078 0.0.0.0:* LISTEN 2364/cpdavd - accep
tcp 0 0 0.0.0.0:2079 0.0.0.0:* LISTEN 2364/cpdavd - accep
tcp 0 0 0.0.0.0:2080 0.0.0.0:* LISTEN 2364/cpdavd - accep
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1275/dovecot
tcp 0 0 0.0.0.0:2082 0.0.0.0:* LISTEN 337953/cpsrvd
tcp 0 0 0.0.0.0:2083 0.0.0.0:* LISTEN 337953/cpsrvd
tcp 0 0 127.0.0.1:579 0.0.0.0:* LISTEN 1939/cPhulkd - proc
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1275/dovecot
tcp 0 0 0.0.0.0:2086 0.0.0.0:* LISTEN 337953/cpsrvd
tcp 0 0 0.0.0.0:36454 0.0.0.0:* LISTEN 5439/sshd
tcp 0 0 0.0.0.0:2087 0.0.0.0:* LISTEN 337953/cpsrvd
tcp6 0 0 :::3306 :::* LISTEN 1215674/mysqld
tcp6 0 0 :::587 :::* LISTEN 656/exim
tcp6 0 0 :::465 :::* LISTEN 656/exim
tcp6 0 0 :::53 :::* LISTEN 1290/pdns_server
tcp6 0 0 :::21 :::* LISTEN 1276/pure-ftpd (SER
tcp6 0 0 :::4949 :::* LISTEN 749/perl
tcp6 0 0 :::25 :::* LISTEN 656/exim
tcp6 0 0 :::36454 :::* LISTEN 5439/sshd
udp 0 0 0.0.0.0:53 0.0.0.0:* 1290/pdns_server
udp 0 0 127.0.0.1:323 0.0.0.0:* 571/chronyd
udp 0 0 127.0.0.1:11211 0.0.0.0:* 1272/memcached
udp6 0 0 :::53 :::* 1290/pdns_server
udp6 0 0 ::1:323 :::* 571/chronyd
mY清漆状态。。。
$systemctl status varnish.service
varnish.service-高性能HTTP加速器varnish Cache已加载:已加载(/usr/lib/systemd/system/varnish.service;已禁用;供应商预设:已禁用)活动:失败(结果:退出代码),自周五起2021-10-08 08:32:43 IDT;5分钟前流程:1498287ExecStart=/usr/sbin/varnishd-a:80-a localhost:8443,PROXY-pfeature=+http2-f/etc/vaminis/default.vcl-s malloc,256m(代码=已退出,状态=255)
和My/etc/varnish/default.vcl文件。。。
$cat /etc/varnish/default.vcl
后端默认值{.host=";127.0.0.1";;.port=";8080〃;}
$journalctl -xe
10月11日18:54:19服务器1。varnishd[176517]:将VCL更新为版本4 10月11日18:54:19服务器1。varnishd[1765617]:vcl 4.1;10月11日18:54:19服务器1。varnishd〔1765617〕:在第一行VCL 10月11日18:54:19服务器1。清漆[1765617]:('/etc/varnish/default.vcl'10月11日18:54:19服务器1。varnishd[176517]:后端默认值{Oct 11 18:54:19 server1。varnishd[176517]:#######--------10月11日18:54:19服务器1。varnishd[176517]:运行VCC编译器失败,10月11日18:54:19server1.varnishd[176517]:10月11日VCL编译失败18:54:19服务器1。systemd[1]:varnish.service:控制过程前10月11日18:54:19服务器1。systemd[1]:无法启动Varnish Cache,a hi Subject:Unit Varnish.service失败定义人:systemd支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel单元varnish.service失败。结果失败。10月11日18:54:19server1.systemd[1]:输入的单元varnish.service在十月失败11 18:54:19服务器1。systemd[1]:varnish.service失败。十月11 18:54:19服务器1。polkitd[533]:未注册的身份验证代理10月11日18:54:24服务器1。鸽派[506582]:lmtp(1764533):从10月11日18:54:24服务器1连接。鸽派[506582]:lmtp(develop@wordwpressplugins10月11日18:54:24服务器1。dovecot[506582]:lmtp(1764533):从断开
谢谢
我的假设
以下错误信息突出显示:
Oct 11 18:54:19 server1. varnishd[1765617]: Update your VCL to Version 4
它指的是您没有在VCL文件中指定VCL版本。
我的测试返回不同的错误:
然而,当它使用运行的AWS实例进行测试时https://aws.amazon.com/marketplace/pp/prodview-ptcusqlqcvvki?sr=0-2&ref_=比格犬&applicationId=AWSMPContessa,我得到以下错误:
Oct 12 08:06:33 varnishd[44646]: Error:
Oct 12 08:06:33 varnishd[44646]: Message from VCC-compiler:
Oct 12 08:06:33 varnishd[44646]: VCL version declaration missing
Oct 12 08:06:33 varnishd[44646]: Update your VCL to Version 4 syntax, and add
Oct 12 08:06:33 varnishd[44646]: vcl 4.1;
Oct 12 08:06:33 varnishd[44646]: on the first line of the VCL files.
Oct 12 08:06:33 varnishd[44646]: ('/etc/varnish/default.vcl' Line 1 Pos 1)
Oct 12 08:06:33 varnishd[44646]: backend default {
Oct 12 08:06:33 varnishd[44646]: #######----------
Oct 12 08:06:33 varnishd[44646]: Running VCC-compiler failed, exited with 2
Oct 12 08:06:33 varnishd[44646]: VCL compilation failed
Oct 12 08:06:33 systemd[1]: varnish.service: Control process exited, code=exited status=255
Oct 12 08:06:33 systemd[1]: varnish.service: Failed with result 'exit-code'.
正如您所看到的,我在AWS上的CloudLinux 8 cPanel实例返回了一条更具体的错误消息。
如何修复
自Varnish 4以来,引入了VCL版本标签。您需要在VCL文件的开头指定它。
以下是我如何重构您的示例:
vcl 4.1;
backend default {
.host = "127.0.0.1";
.port = "8080";
}
我使用
vcl 4.1;
作为VCL版本标签,因为您正在运行Varnish 6。早期版本的Varnish仅支持vcl 4.0;