2010年(52)
分类:
2010-06-28 13:01:44
1、基本命令
nginx –v 显示nginx的版本
[root@localhost sbin]# ./nginx -v
nginx version: nginx/0.5.34
nginx –V 显示nginx的版本,编译器和配置参数
[root@localhost sbin]# ./nginx -V
nginx version: nginx/0.5.34
built by gcc 3.4.6 20060404 (Red Hat 3.4.6-3)
configure arguments: --prefix=/usr/local/nginx_2 --with-http_stub_status_module
nginx –t 不运行,仅仅测试配置文件
nginx –c 为nginx指定配置文件
[root@localhost sbin]# ./nginx -t -c /usr/local/nginx_2/conf/nginx_status.conf
2008/01/26 18:34:40 [info] 4242#0: the configuration file /usr/local/nginx_2/conf/nginx_status.conf syntax is ok
2008/01/26 18:34:40 [info] 4242#0: the configuration file /usr/local/nginx_2/conf/nginx_status.conf was tested successfully
启动nginx
/usr/local/nginx_2/sbin/nginx –c /usr/local/nginx_2/conf/nginx_status.conf
注:如果不指定配置文件,系统会按照Nginx安装目录下conf/nginx.conf的配置启动。
退出nginx
kill -QUIT nginx_pid
kill -TERM nginx_pid
2、重启Nginx
kill -HUP `cat /opt/nginx/logs/nginx.pid`
3、启动Nginx
/opt/nginx/sbin/nginx