nginx实时监视访问状态(ngxtop)(3)

发表于:2014-07-08来源:不详作者:凉白开点击数: 标签:软件测试
ngxtop 4. 注意事项 4.1 ngxtop单条命令无法执行 # ngxtop Error: Access log file or format was not set and nginx config file cannot be detected. Perhaps nginx is not in your PATH? 意识说ng

  ngxtop

  4. 注意事项 4.1 ngxtop单条命令无法执行

  # ngxtop

  Error: Access log file or format was not set and nginx

  config file cannot be detected. Perhaps nginx is not in your PATH?

  意识说nginx执行文件要加到PATH路径中, 方法一:软连接

  # ln -s /usr/local/nginx-1.5.2/sbin/nginx /sbin/

  方法二:修改环境变量

  # vim /etc/profile

  export PATH=$PATH:/usr/local/nginx-1.5.2/sbin

  # source /etc/profile

  方法三:指定配置文件

  # ngxtop -c /usr/local/nginx-1.5.2/conf/nginx.conf

  4.2 虚拟主机配置文件必须在nginx.conf主配置中 一般情况下,我们会将虚拟主机单独写到一个配置文件中,然后nginx.conf做个include。例如我们站点www.ttlsa.com 配置文件:/usr/local/nginx-1.5.2/conf/vhost/www.ttlsa.com.conf 再nginx.conf的http段中添加include vhost/*.conf 这种情况下ngxtop不支持,必须要保证所有配置都在nginx.conf中才行。不知道是否我哪里理解不对,如果是的话,知道的兄弟留言告知。本人在此感激不尽。 5. 结束 ngxtop非常实用,值得推荐。 项目地址:https://github.com/lebinh/ngxtop

原文转自:http://huidu.lanxijun.com/articleDetail.html?id=19619&from=huidu&platform=android