After varnish is installed and started, the following error occurs when the varnishlog command is used: Cannot open/usr/local/varnish/var/varnish/test. localdomain /_. vsm: No such file or directory
650) this. width = 650; "src =" http://img1.51cto.com/attachment/201309/160523412.jpg "title =" tempUnnamed QQ Screenshot20130913155003.JPG "alt =" 160523412.jpg"/>
Run the command # ls/usr/local/varnish/var/varnish to check whether the directory test. localdomain does not exist.
Solution 1:
If you use-n <instancename>
So varnishlog must be added.-n <instancename>。
Note: If you do not know whether the-n option is added and it is started with servcie varnishd start or/etc/init. d/varnishd start, cat/Etc/init. d/varnishd | more.
Solution 2:
1. Use ps-ef | grep varnishd to view the varnishd pid.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/06061W330-1.jpg "title =" tempUnnamed QQ Screenshot20130913155127.JPG "alt =" 160700965.jpg"/>
We can see that I have two varnishd processes here, because the varnishd execution user set in the varnish configuration file is www, so here it should be 2563
2,Use lsof-p <varnishd
PID> | grep vsm VIEW _ actual vsm path
What I already know in the previous stepvarnishd
PID
Is 2563, so the command here is
Lsof-p 2563 | grep vsm
3. mkdir/usr/local/varnish/var/varnish/test. localdomain/
Note: The test. localdomain here should be the host name in your error prompt
4. Create a soft link to the _. vsm path shown above
# Ln-s/var/log/varnish/_. vsm/usr/local/varnish/var/varnish/test. localdomain/_. vsm
5. Execute #./varnishlog
Access the http proxy service of varnish to view the log.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/06061S119-2.jpg "title =" tempUnnamed QQ Screenshot20130913155253.JPG "alt =" 162612148.jpg"/>
Reference: http://stackoverflow.com/questions/12165818/varnish-cache-log-not-working
This article from the "Idle pool small building" blog, please be sure to keep this source http://soarwilldo.blog.51cto.com/5520138/1296500