首页 > 代码库 > Linux(CentOS6.5)下编译安装Nginx1.10.1

Linux(CentOS6.5)下编译安装Nginx1.10.1

首先在特权账号(root)下安装编译时依赖项:

yum install gcc gcc-c++ perl -y

 

首先以非特权账号(本文以账号comex为例)登陆OS:

技术分享

进入data目录下载相关安装介质

技术分享

mkdir /comexData/packagecd /comexData/packagewget http://nginx.org/download/nginx-1.10.1.tar.gzwget http://120.52.73.43/jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gzwget https://www.openssl.org/source/openssl-1.0.2h.tar.gzwget http://zlib.net/zlib-1.2.8.tar.gz

 

然后解压文件

cd /comexData/packagetar -zxf nginx-1.10.1.tar.gz tar -zxf pcre-8.38.tar.gztar -zxf zlib-1.2.8.tar.gztar -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

 

技术分享

Linux(CentOS6.5)下编译安装Nginx1.10.1