安装varnish的问题

简介:

安装完varnish后,发现bin目录下并未有varnishtop,varnishstat,varnishhist这三个命令

 
  1. # ll /usr/local/varnish3/bin/ 
  2. total 480 
  3. -rwxr-xr-x. 1 root root  49968 Nov 13 17:03 varnishadm 
  4. -rwxr-xr-x. 1 root root  65908 Nov 13 17:03 varnishlog 
  5. -rwxr-xr-x. 1 root root  82060 Nov 13 17:03 varnishncsa 
  6. -rwxr-xr-x. 1 root root  67083 Nov 13 17:03 varnishreplay 
  7. -rwxr-xr-x. 1 root root 212398 Nov 13 17:03 varnishtest 

于是在源码目录里找了下,发现源码根目录下有这样一个目录bin

 
  1. bin]# ll 
  2. total 92 
  3. -rw-r--r--. 1 root root      18227 Nov 13 17:01 Makefile 
  4. -rw-r--r--. 1  108 nfsnobody   163 Aug 20 17:20 Makefile.am 
  5. -rw-r--r--. 1  108 nfsnobody 18036 Aug 20 17:20 Makefile.in 
  6. drwxr-xr-x. 4  108 nfsnobody  4096 Nov 13 17:02 varnishadm 
  7. drwxr-xr-x. 4  108 nfsnobody 12288 Nov 13 17:03 varnishd 
  8. drwxr-xr-x. 3  108 nfsnobody  4096 Nov 13 17:01 varnishhist 
  9. drwxr-xr-x. 4  108 nfsnobody  4096 Nov 13 17:03 varnishlog 
  10. drwxr-xr-x. 4  108 nfsnobody  4096 Nov 13 17:03 varnishncsa 
  11. drwxr-xr-x. 4  108 nfsnobody  4096 Nov 13 17:03 varnishreplay 
  12. drwxr-xr-x. 3  108 nfsnobody  4096 Nov 13 17:01 varnishsizes 
  13. drwxr-xr-x. 3  108 nfsnobody  4096 Nov 13 17:01 varnishstat 
  14. drwxr-xr-x. 5  108 nfsnobody  4096 Nov 13 17:03 varnishtest 
  15. drwxr-xr-x. 3  108 nfsnobody  4096 Nov 13 17:01 varnishtop 

这不是我要找的东西么,很兴奋,随便看了一下Makefile,make一下试试

 
  1. varnishstat]# make 
  2. gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../include    -g -O2 -pthread -Wextra -Wno-missing-field-initializers -Wno-sign-compare -MT varnishstat.o -MD -MP -MF .deps/varnishstat.Tpo -c -o varnishstat.o varnishstat.c 
  3. mv -f .deps/varnishstat.Tpo .deps/varnishstat.Po 
  4. gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../include    -g -O2 -pthread -Wextra -Wno-missing-field-initializers -Wno-sign-compare -MT varnishstat_curses.o -MD -MP -MF .deps/varnishstat_curses.Tpo -c -o varnishstat_curses.o varnishstat_curses.c 
  5. varnishstat_curses.c: In function ‘do_curses’: 
  6. varnishstat_curses.c:145: warning: implicit declaration of function ‘initscr’ 
  7. varnishstat_curses.c:146: warning: implicit declaration of function ‘raw’ 
  8. varnishstat_curses.c:147: warning: implicit declaration of function ‘noecho’ 
  9. varnishstat_curses.c:148: warning: implicit declaration of function ‘nonl’ 
  10. varnishstat_curses.c:149: warning: implicit declaration of function ‘intrflush’ 
  11. varnishstat_curses.c:149: error: ‘stdscr’ undeclared (first use in this function) 
  12. varnishstat_curses.c:149: error: (Each undeclared identifier is reported only once 
  13. varnishstat_curses.c:149: error: for each function it appears in.) 
  14. varnishstat_curses.c:149: error: ‘FALSE’ undeclared (first use in this function) 
  15. varnishstat_curses.c:150: warning: implicit declaration of function ‘curs_set’ 
  16. varnishstat_curses.c:158: warning: implicit declaration of function ‘erase’ 
  17. varnishstat_curses.c:159: warning: implicit declaration of function ‘refresh’ 
  18. varnishstat_curses.c:187: warning: implicit declaration of function ‘mvprintw’ 
  19. varnishstat_curses.c:187: error: ‘COLS’ undeclared (first use in this function) 
  20. varnishstat_curses.c:215: error: ‘LINES’ undeclared (first use in this function) 
  21. varnishstat_curses.c:228: warning: implicit declaration of function ‘addstr’ 
  22. varnishstat_curses.c:241: warning: implicit declaration of function ‘timeout’ 
  23. varnishstat_curses.c:242: warning: implicit declaration of function ‘getch’ 
  24. varnishstat_curses.c:243: error: ‘ERR’ undeclared (first use in this function) 
  25. varnishstat_curses.c:252: warning: implicit declaration of function ‘redrawwin’ 
  26. varnishstat_curses.c:264: warning: implicit declaration of function ‘endwin’ 
  27. varnishstat_curses.c:279: warning: implicit declaration of function ‘beep’ 
  28. make: *** [varnishstat_curses.o] Error 1 

无论选择哪一个,都是make出错。源码bin根目录下,亦是如此。查了一下,原来是这样:

 
  1. 如果你在编译的vasnish中的bin目录没有发现varnishstat, varnishtop, varnishhist这个三个程序的话,
  2. 是因为编译前没有安装与操作系统位数对应的ncurses-devel。 

安装ncurses-devel即可,yum install ncurses-devel.x86_64

然后不需要重新编译varnish了,直接执行varnish目录下的 autogen.sh 自动关联新的环境,之后直接进入 {varnish-source}\bin\{varnishstat|varnishtop|varnishhist} 运行make 即可。

 
  1. # sh autogen.sh  
  2. # 进入相关目录,make && make install

本文转自dongfang_09859 51CTO博客,原文链接:http://blog.51cto.com/hellosa/1061555,如需转载请自行联系原作者
相关文章
|
1月前
|
存储 缓存 运维
LAMP+Varnish缓存详解(一)——Varnish简介
LAMP+Varnish缓存详解(一)——Varnish简介
18 0
|
存储 缓存 监控
|
缓存 前端开发 JavaScript
|
存储 Web App开发 缓存
|
Web App开发 存储 缓存
|
Web App开发 缓存 测试技术
|
缓存 前端开发 区块链