Linux下安装Nginx

来源:互联网 发布:淘宝男裤子店铺排名 编辑:程序博客网 时间:2024/04/30 03:04
<pcre>
(1)
下载
http://exim.mirror.fr/pcre/

安装
tar -xvzf pcre-8.38.tar.gz
cd pcre-8.38
./configure --prefix=/appl/pcre-8.38
make
make check
make install

检验
which pcre

(2)
yum install pcre-devel openssl-devel patch -y


<openssl>
(1)
下载
http://distfiles.macports.org/openssl/

安装
tar -xzf openssl-1.0.2.tar.gz
cd openssl-1.0.2
./config --prefix=/appl/openssl-1.0.2
./config -t
make  (需要GCC编译器,如没有则:yum -y install gcc, yum install wget make gcc gcc-c++  -y)
make check
make install

检验
which openssl
openssl version

(2)
yum install pcre-devel openssl-devel patch -y


<zlib>
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8
./configure
make
make install


<Nginx>
下载
a. http://mirrors.sohu.com/nginx/
b. wget http://nginx.org/download/nginx-0.8.53.tar.gz

安装
前置包:pcre, openssh, (部分系统还需要zlib)
tar -xvzf nginx-1.9.9.tar.gz
cd nginx-1.9.9
./configure --prefix=/appl/nginx-1.9.9 --with-http_stub_status_module --with-http_ssl_module --with-pcre=/appl/pcre-8.38 --with-openssl=/appl/openssl-1.0.2 (may also need --with-zlib=/usr/src/zlib-1.2.7)
make
make check
make install

启动
/appl/nginx-1.9.9/sbin/nginx
停止
/appl/nginx-1.9.9/sbin/nginx -s stop
重载
/appl/nginx-1.9.9/sbin/nginx -s reload

检验
netstat -ano|grep 80
http://<ip>:80

Other setting:
http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3118061.html
http://blog.csdn.net/yincg/article/details/8756711http://blog.csdn.net/superbirds/article/details/7290504
0 0