系统相关
首页 > 系统相关> > [Nginx/Linux/CENTOS]安装 Nginx

[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

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