1、测试新的Nginx程序是否正确

[test@P-SH-Nginx-01 nginx]$ ./sbin/nginx -t

nginx: the configuration file /usr/local/openresty/nginx/conf/nginx.conf syntax is ok

nginx: [emerg] open() "/usr/local/openresty/nginx/logs/access.log" failed (13: Permission denied)

nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed

2、启动Nginx

test@P-SH-Nginx-01 openresty]$ sudo ./nginx/sbin/nginx -c conf/nginx.conf

/usr/local/nginx/sbin/nginx -t

nginx: theconfiguration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx:configuration file /usr/local/nginx/conf/nginx.conf test issuccessful

3、查看Nginx是否已经启动起来

[test@P-SH-Nginx-01 openresty]$ ps -ef |grep nginx

root      46505      1  0 01:41 ?        00:00:00 nginx: master process ./nginx/sbin/nginx -c conf/nginx.conf

nobody    46506  46505  0 01:41 ?        00:00:00 nginx: worker process

test      46528  28392  0 01:42 pts/0    00:00:00 grep --color=auto nginx

4、查看Ngixn版本及其编译参数,注意参数是大写字母V

[test@P-SH-Nginx-01 openresty]$  ./nginx/sbin/nginx -V

nginx version: openresty/1.11.2.5

built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

built with OpenSSL 1.0.2k-fips  26 Jan 2017

TLS SNI support enabled

configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.05 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.31 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.06 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.10 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.32 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.18 --add-module=../redis2-nginx-module-0.14 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.14 --add-module=../rds-csv-nginx-module-0.07 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-http_stub_status_module --with-http_ssl_module

5、验证Nginx是否正常运行

[test@P-SH-Nginx-01 openresty]$ curl -I http://127.0.0.1

HTTP/1.1 200 OK

Server: openresty/1.11.2.5

Date: Fri, 15 Dec 2017 01:58:18 GMT

Content-Type: text/html

Content-Length: 562

Last-Modified: Thu, 26 Oct 2017 04:12:11 GMT

Connection: keep-alive

ETag: "59f1609b-232"

Accept-Ranges: bytes

6、重启Nginx

[test@P-SH-Nginx-01 openresty]$ sudo ./nginx/sbin/nginx -s reload

最新文章

  1. 决策树ID3算法的java实现(基本试用所有的ID3)
  2. 安装Linux 16.04 时,选择好分区后,进到选择地点的界面后,总是闪退,退到最原始的界面
  3. cvBox2D和RotatedRect中返回的角度angle详解
  4. Codeforces Round #233 (Div. 2) A、Pages
  5. Winform开发框架之客户关系管理系统(CRM)的开发总结系列2-基于框架的开发过程
  6. c++l类
  7. Tkinter教程之Canvas篇(2)
  8. 刚安装完jdk和eclipse需要配置什么?
  9. C++中如何建立一个顺序表
  10. VC++ win32 多线程 一边画圆一边画矩形
  11. JavaScript 中的事件类型1(读书笔记思维导图)
  12. 201521123051《Java程序设计》第十周学习总结
  13. Docker镜像的实现原理
  14. Nginx中if语句中的判断条件
  15. day14 Python集合的补充
  16. 小C的数学问题 【单调栈】
  17. P2512 [HAOI2008]糖果传递
  18. Android Touch事件派发流程源码分析
  19. Buffer Pool--SQL Server:Buffer Manager 对象
  20. httpClient-3.1学习笔记

热门文章

  1. 148. Sort List - LeetCode
  2. 用python实现输入三边判断能否组成三角形
  3. sklearn数据集的导入及划分
  4. 「JOISC 2020 Day1」汉堡肉
  5. 我的第一个开源作品Kiwis2 Mock Server
  6. 管理订单状态,该上状态机吗?轻量级状态机COLA StateMachine保姆级入门教程
  7. net core天马行空系列-微服务篇:全声明式http客户端feign快速接入微服务中心nacos
  8. ROS基本程序实现
  9. Spire.Office激活
  10. CSCMS代码审计