Linux(CentOS6.5)下编译安装Nginx1.10.1
首先在特权账号(root)下安装编译时依赖项:
yum install gcc gcc-c++ perl -y
首先以非特权账号(本文以账号comex为例)登陆OS:
进入data目录下载相关安装介质
mkdir /comexData/package cd /comexData/package wget http://nginx.org/download/nginx-1.10.1.tar.gz wget http://120.52.73.43/jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz wget http://zlib.net/zlib-1.2.8.tar.gz
然后解压文件
cd /comexData/package tar -zxf nginx-1.10.1.tar.gz tar -zxf pcre-8.38.tar.gz tar -zxf zlib-1.2.8.tar.gz tar -zxf openssl-1.0.2h.tar.gz
cd /comexData/package/nginx-1.10.1 ./configure --prefix=/comexHome/nginx \ --pid-path=/comexHome/nginx/nginx.pid \ --error-log-path=/comexLog/nginx/error.log \ --http-log-path=/comexLog/nginx/access.log \ --with-http_ssl_module \ --with-mail --with-mail_ssl_module \ --with-stream --with-threads \ --user=comex --group=comexgroup \ --with-pcre=/comexData/package/pcre-8.38 \ --with-zlib=/comexData/package/zlib-1.2.8 \ --with-openssl=/comexData/package/openssl-1.0.2h
然后安装:
make && make install
测试:
/comexHome/nginx/sbin/nginx -V