nginx安装

(一)首先要安装pcre ,他作用是让ngnix支持rewrite功能

yum -y install make zlib zlib-devel gcc-c++ libtool

mkdir -p /home/oldboy/tools

cd /home/oldboy/tools

wget http://sourceforge.jp/frs/g_redir.php?m=jaist&f=%2Fpcre%2Fpcre%2F8.30%2Fpcre-8.30.tar.gz

tar zxf pcre-8.30.tar.gz

cd pcre-8.30/

./configure 

make&&make install

cd ../

 

 

(二)安装nginx

cd /home/oldboy/tools

wget http://nginx.org/download/nginx-1.2.3.tar.gz

useradd nginx -s /sbin/nologin -M 

tar zxf nginx-1.2.3.tar.gz

cd nginx-1.2.3

./configure --user=nginx --group=nginx --prefix=/application/nginx-1.2.3 --with-http_stub_status_module --with-http_ssl_module (如果有报错就yum -y install openssl*)

make && make install

 

 

3.启动nginx

cd /usr/local/nginx/sbin

./nginx

如果报错:./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

则做软链接:

ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1  

有些是lib目录做上诉操作

 

 

如果make时候缺失aclocal:

###安装autoconf

wget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz \
&& tar -xzvf autoconf-2.65.tar.gz \
&& cd autoconf-2.65 \
&& ./configure --prefix=/usr/local
make && make install
cd ..

###安装automake

wget http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz \
&& tar xzvf automake-1.11.tar.gz \
&& cd automake-1.11 \
&& ./configure --prefix=/usr/local
make && make install
cd ..

如果仍然按照pcre失败,可以重新make clean或者重新解压再安装pcre
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值