Linux环境下安装Nginx+Pcre+OpenSSL

Nginx需要其他第三方库的支持,比如rewrite模块需要pcre库,ssl需要openssl库

1、  PCRE库的安装:

官网:http://www.pcre.org/

选择最新版本下载:

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz

解压:

tar –zxvf pcre-8.10.tar.gz,解压目录为:pcre-8.10

然后进入到 cd pcre-8.10,进行配置、编译、安装

./configure && make && make install


2、  OpenSSL库的安装

官网:http://www.openssl.org

下载页面:http://www.openssl.org/source/

选择最新版本下载

http://www.openssl.org/source/openssl-1.0.0a.tar.gz

tar –zxvf openssl-1.0.0.tar.gz,解压目录为:openssl-1.0.0

然后进入到 cd openssl-1.0.0,进行配置、编译、安装

./configure && make && make install


3、  nginx安装

官网:http://nginx.org

下载页面:http://nginx.org/en/download.html

选择最新版本下载:

http://nginx.org/download/nginx-0.8.53.tar.gz

解压:

tar –zxvf nginx-0.8.53.tar.gz,解压目录为:nginx-0.8.53

然后进入到 cd nginx-0.8.53,进行配置、编译、安装

按照一般的说明,也就是通过./config或./configure直接进行配置了,但配置后,在编译make的时候很可能会报:

*** No rule to make target `clean’.  Stop.

等这样的错误,所以仅仅通过./configure来进行配置是不够的,至少在配置的时候需要指定openssl的安装目录,比如我的openssl安装目录是:openssl-1.0.0,则在配置的时候应该为:

./configure –with-http_stub_status_module –with-http_ssl_module

–with-openssl=/usr/local/openssl-1.0.0 –with-http_gzip_static_module

这样在编译的时候才会成功,接下来就是安装:make install

安装成功后,会生成一个nginx的目录。

最后附完整安装例子语句:

./configure –with-http_stub_status_module –with-http_ssl_module –with-openssl=/usr/local/openssl-1.0.0e –with-pcre=/usr/local/pcre-8.13 –with-http_gzip_static_module


如果用yum 安装就这样

yum -y install pcre-devel

yum -y install openssl-devel


./configure --user=refresh --group=refresh  --with-http_stub_status_module --with-http_ssl_module


make && make install



用yum安装库 的安装脚本

echo '......install nginx........'
wget http://nginx.org/download/nginx-1.4.1.tar.gz
tar xvf nginx-1.4.1.tar.gz
cd nginx-1.4.1
yum -y install pcre-devel
yum -y install openssl-devel
./configure --user=refresh --group=refresh  --with-http_stub_status_module --with-http_ssl_module
make && make install
cd ..

wget https://pdsh.googlecode.com/files/pdsh-2.29.tar.bz2
tar xvf  pdsh-2.29.tar.bz2 && cd pdsh-2.29
./configure --with-ssh --without-rsh && make && make install


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值