- 依赖解决
安装pcre库(Perl Compatible Regular Expressions;perl兼容正则表达式),为了使nginx支持具备URL重写功能的Rewrite模块。
# yum -y install pcre pcre-devel
# yum -y install openssl openssl-devel gcc
- 依赖检查
# rpm -qa pcre pcre-devel
- 服务安装
# wget http://nginx.org/download/nginx-1.12.1.tar.gz
# tar axvf nginx-1.12.1.tar.gz
# useradd nginx -s /sbin/nologin -M
# cd nginx-1.12.1
# ./configure --help
# ./configure --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --prefix=/usr/local/nginx-1.12.1/
# make
# make install
- 链接完善
# ln -sv /usr/local/nginx-1.12.1 /usr/local/nginx
- 服务启动
# /usr/local/nginx/sbin/nginx -t
# /usr/local/nginx/sbin/nginx
- 功能检测
WINDOS:浏览器直接输入ip,即可出现nginx页面;
LINUX:# curl -I 127.0.0.1
HTTP/1.1 200 OK
Server: nginx/1.12.1
Date: Sun, 03 Sep 2017 12:53:41 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Sun, 03 Sep 2017 12:35:56 GMT
Connection: keep-alive
ETag: "59abf72c-264"
Accept-Ranges: bytes
-------------------------------------------------------------
转载请保留此段声明,且在文章页面明显位置给出原文链接,谢谢!
------------------------------------------------------------------------------
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!
------------------------------------------------------------------------------