1 --先安装PCRE作用是让Nginx支持重写功能。
下载PCRE安装包,下载地址:
http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz http://www.pcre.org/
tar -zxvf pcre-8.38.tar.gz cd pcre-8.38 ./configure --prefix=/app/pcressl/pcre-8.38 #make && make install
报错:configure: error: You need a C++ compiler for C++ support
需要安装: yum install -y gcc gcc-c++
2 --安装 openssl openssl-1.0.2n.tar 强大的安全套接字层密码库
tar -xvf openssl-1.0.2n.tar cd openssl-1.0.2n ./config --prefix=/app/pcressl/openssl-1.0.2n # make && make install
3.--安装zlib 为的是解包gzip http://www.zlib.net/
tar -xvf zlib-1.2.11.tar cd zlib-1.2.11 ./configure --prefix=/app/pcressl/zlib-1.2.11 # make && make install
4 --安装阿里云 nginx
下载地址:
http://tengine.taobao.org/document_cn/install_cn.html
tar -zxvf tengine-2.2.3.tar.gz cd tengine-2.2.3
全部复制:
./configure --prefix=/wt/nginx --with-http_stub_status_module --with-http_ssl_module --with-openssl=/wt/tools/openssl-1.0.2n --with-pcre=/wt/tools/pcre-8.38 --with-zlib=/wt/tools/zlib-1.2.11
注意!!! 后面的路径说的是源码路径不是安装的路径,打错会报目录不存在 错误2
make make install
报错 nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
更改端口,小端口没有权限访问。。
热安装:
./configure --prefix=/app/nginx --with-http_stub_status_module --with-http_ssl_module --with-openssl=/app/tools/openssl-1.0.2n --with-pcre=/app/tools/pcre-8.42