Nginx源码编译安装
下载Nginx
Nginx1.10.0.tar.gz
wget http://nginx.org/download/nginx-1.10.0.tar.gz
Nginx-1.12.1.tar.gz
wget https://nginx.org/download/nginx-1.12.1.tar.gz
Nginx-1.13.5.tar.gz
wget https://nginx.org/download/nginx-1.13.5.tar.gz
官网获取最新版本
http://nginx.org/en/download.html
安装Nginx相关依赖包
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
解包配置
tar -zxf nginx-1.10.0.tar.gz
cd nginx-1.10.0
./configure \
--prefix=/usr/local/nginx \
--sbin-path=/usr/local/nginx/sbin/ \
--conf-path=/usr/local/nginx/conf/nginx.conf \
--with-http_ssl_module --user=www --group=www \
--with-http_gzip_static_module --with-http_stub_status_module \
--with-http_realip_module
编译安装
make && make install
查看版本
/usr/local/nginx/sbin/nginx -V
启动Nginx服务
/usr/local/nginx/sbin/nginx
本文出自 “Linux运维-小墨” 博客,请务必保留此出处http://xmomo.blog.51cto.com/5994484/1970103
原文地址:http://xmomo.blog.51cto.com/5994484/1970103