Linux编译Nginx最新版(nginx-1.11.6)

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

下载相关组件源码

组件名 组件官网 直接下载地址
pcre http://www.pcre.org/ http://120.52.73.43/jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz
openssl https://www.openssl.org/source/ https://www.openssl.org/source/openssl-1.0.2j.tar.gz
zlib http://zlib.net/ http://www.zlib.net/zlib-1.2.10.tar.gz
nginx http://nginx.org/ http://nginx.org/download/nginx-1.11.6.tar.gz

1.解压

 tar -zxf nginx-1.11.6.tar.gz
 tar -zxf pcre-8.38.tar.gz
 tar -zxf zlib-1.2.9.tar.gz
 tar -zxf openssl-1.0.2j.tar.gz

2.执行编译

cd /nginx-1.11.6
./configure --prefix=/usr/local/nginx 
--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=/home/bool/下载/nginx/pcre-8.38
--with-zlib=/home/bool/下载/nginx/zlib-1.2.9 
--with-openssl=/home/bool/下载/nginx/openssl-1.0.2j

 

./configure --prefix=/usr/local/nginx --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=/pcre-8.38 --with-zlib=/zlib-1.2.9 --with-openssl=/openssl-1.0.2j

 

然后执行make安装

make

执行make install

make install

验证nginx:

/comexHome/nginx/sbin/nginx -V

启动nginx,验证是否可以访问

127.0.0.1

转载于:https://my.oschina.net/sloan521/blog/807978

你可能感兴趣的:(Linux编译Nginx最新版(nginx-1.11.6))