我刚刚安装了清漆,它可以为网页提供服务。
问题是我们达到了打开文件的限制
我们已经将ulimit
设置为清漆用户。
我们想找到一个文件,我们可以写这个配置:
# Maximum number of open files
NFILES=131072
# Locked shared memory, default log size is 82MB + header
MEMLOCK=82000
## Configuration with VCL
#
# Listen on port 80, administration on localhost:6082, and forward to
# one content server selected by the vcl file, based on the request. Use a
# fixed-size cache file.
#
# Note: you must replace "example.org" with the outside IP address of your server
# - this is the address at which Varnish receives incoming requests.
# $wgSquidServers in MediaWiki's LocalSettings.php will also need to list all addresses for this Varnish cache.
#
DAEMON_OPTS="-a example.org:80
-T localhost:6082
-f /etc/varnish/default.vcl
-u varnish -g varnish
-s file,/var/lib/varnish/varnish_storage.bin,4G"
您要查找的文件是Varnish守护进程配置脚本。如果你在Redhat/REL上,你可以(通常)在/etc/sysconfig/varnish
中找到它,如果你在Debian/Ubuuntu 上,你也可以在/etc/default/varnish
中找到它
有两个地方需要进行清漆配置:
/etc/default/varnish
/etc/varnish/default.vcl
这是在centos linux服务器上
/etc/sysconfig/varnish
/etc/varnish/default.vcl
如果你想在apache前面加上清漆,你还必须更改httpd配置文件来更改端口
/etc/httpd/conf/httpd.conf
来源:如何在Centos 6 上使用Apache安装和配置Varnish
同样值得注意的是,编辑后重新加载varnish配置会清除它的缓存。