在使用带有Varnish的内联C时,我无法获得/etc/varnish/default
在刚开始的时候要快乐。
我已经使用varnish测试了内联C的两个功能: GeoIP检测和反站点抓取函数。
DAEMON_OPTS总是抱怨,即使我关注的是其他人
指示工作正常。
我的问题是这个命令行启动是有效的:
varnishd -f /etc/varnish/varnish-default.conf -s file,/var/lib/varnish/varnish_storage.bin,512M -T 127.0.0.1:2000 -a 0.0.0.0:8080 -p 'cc_command=exec cc -fpic -shared -Wl,-x -L/usr/include/libmemcached/memcached.h -lmemcached -o %o %s'但它在尝试从默认启动脚本启动时出错:
/etc/default/varnish中包含以下内容:
DAEMON_OPTS="-a :8080 \
-T localhost:2000 \
-f /etc/varnish/varnish-default.conf \
-s file,/var/lib/varnish/varnish_storage.bin,512M \
-p 'cc_command=exec cc -fpic -shared -Wl,-x -L/usr/include/libmemcached/memcached.h -lmemcached -o %o %s'"错误是:
# /etc/init.d/varnish start
Starting HTTP accelerator: varnishd failed!
storage_file: filename: /var/lib/varnish/vbox.local/varnish_storage.bin size 512 MB.
Error:
Unknown parameter "'cc_command".如果我尝试将最后一行更改为:
-p cc_command='exec cc -fpic -shared -Wl,-x -L/usr/include/libmemcached/memcached.h -lmemcached -o %o %s'"现在的错误是:
# /etc/init.d/varnish start
Starting HTTP accelerator: varnishd failed!
storage_file: filename: /var/lib/varnish/vbox.local/varnish_storage.bin size 512 MB.
Error: Unknown storage method "hared"它试图将“-shared”解释为-s共享,而“shared”不是存储类型。
对于GeoIP和反站点刮擦,我使用了完全推荐的守护进程选项
此外,我尝试了各种变体,如添加\‘和'’,但没有joy。
这里有一个指向我遵循的说明的链接,除了DAEMON_OPTS部分之外,它工作得很好。
http://drcarter.info/2010/04/how-fighting-against-scraping-using-varnish-vcl-inline-c-memcached/
我使用的是Debian和说明书中所说的DAEMON_OPTS。
有人能帮我指出这里出了什么问题吗?
非常感谢!
发布于 2017-10-25 19:21:24
您可以尝试使用:- DAEMON_OPTS="-a :8080 \ -T本地主机:2000\ -f /etc/varnish/varnish-default.conf \ -s文件,/var/lib/varnish/varnish_storage.bin,512M \ -p cc_command='exec cc -fpic -shared -Wl,-x -L/usr/include/libmemcached/memcached.h -lmemcached -o %o%s‘“
发布于 2011-10-17 03:34:11
显然,解释DAEMON_OPTS的启动脚本没有准备好使用空格(即使是在单引号内)。在我的Fedora (15)安装中,建议的解决方案工作得很好;参数得到了正确的解释,因为在daemon()中的/etc/init.d/ "$*"和/etc/init.d/函数中传递了varnish参数。
您是从包中获取启动脚本还是自定义脚本?
发布于 2015-12-19 00:05:41
这与问题没有直接关系,但如果您正在使用Varnish Tutorial - Put Varnish on port 80,您可能会发现自己在这里。
对于最近在Debian系统上安装的Varnish,可以在/etc/systemd/system/multi-user.target.wants/varnish.service中找到varnishd启动选项的配置。记录在案的通过/etc/default/varnish更改端口的方法仍然存在,但除非您将系统更改为使用init脚本而不是systemd,否则该方法将不再起作用。
在/etc/systemd/system/multi-user.target.wants/varnish.service中更改选项后,不要忘记运行systemctl daemon-reload,它将编目执行程序所做的更改。
https://stackoverflow.com/questions/5906603
复制相似问题