CentOS安装配置nginx

参考文档:http://www.nginx.cn/install,大神写的很详细了,这里就不在重复了

1、准备工作(yum install gcc gcc-c++

 下载需要配置、编译、安装的各种组件(nginx-1.12.0.tar.gz、openssl-1.1.0e.tar.gz、pcre-8.37.tar.gz、zlib-1.2.11.tar.gz) 

2、解压、编译、安装nginx

./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/nginx.pid

--error-log-path=/usr/local/nginx/error.log --http-log-path=/usr/local/nginx/access.log --with-http_ssl_module

--with-pcre=/usr/local/src/pcre-8.36 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/src/openssl-1.0.1e

3、验证是否安装成功(/usr/local/nginx/sbin/nginx -V)

4、启动nginx服务(/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf)

5、配置反向代理

 

posted @ 2017-06-13 11:47  那年、那天  阅读(119)  评论(0编辑  收藏  举报