[Nginx/Linux/CENTOS]安装 Nginx
作者:互联网
1 基本信息
服务器OS : Linux CENTSO 7.9
待安装的Nginx版本: NGINX 15.12
2 安装过程
step1 下载安装包
# cd /usr/local/software/
# wget http://nginx.org/download/nginx-1.15.12.tar.gz
step2 解压安装包
# cd /usr/local/software/
# tar -zxvf nginx-1.15.12.tar.gz -C ./
step3 安装依赖项
解决异常: ./configure时报的异常:
./configure: error: the HTTP rewrite module requires the PCRE library. ...
参考文献
安装nginx时候提示:./configure: error: the HTTP rewrite module requires the PCRE library. - CSDN
# yum -y install gcc gcc-c++ automake autoconf libtool make
# yum -y install pcre-devel openssl openssl-devel
step4 配置与安装前检查
cd /usr/local/software/nginx-1.15.12
./configure --prefix=/usr/local/software/nginx-1.15.12 \
--conf-path=/usr/local/nginx-1.15.12/conf \
--with-http_stub_status_module
- ./configure --help
- --prefix=PATH 设置软件安装目录路径
- --with-http_stub_status_module 启用HTTP_Stub_Status模块,状态信息统计模块,用于返回一个Nginx状态信息统计信息页面。管理员访问这个页面可以获取Nginx的请求处理、当前连接、等待连接等统计信息,一般用于监控Nginx的运行状态。默认情况下不构建此模块。
- --conf-path=PATH 设置配置文件安装目录路径


step5 编译
cd /usr/local/software/nginx-1.15.12
make

step6 安装
cd /usr/local/software/nginx-1.15.12
make install

step7 查验版本
/usr/local/software/nginx-1.15.12/sbin/nginx -V

step8 查验运行状态

X 参考文献
标签:1.15,CENTOS,nginx,--,Nginx,12,usr,Linux,local 来源: https://www.cnblogs.com/johnnyzen/p/14888336.html