在Ubuntu 11.04中安装Openresty

本文记录一下我在Ubuntu 11.04中安装Openresty的过程,仅供参考。

1.下载源码

http://www.openresty.org/网站下载最新openresty的源码,按照网页所述步骤进行解压。

2.配置

cd到代码目录,进行./configure。我使用的是./configure --with-luajit,此时,提示出错了:

checking for PCRE library ... not found
checking for PCRE library in /usr/local/ ... not found
checking for PCRE library in /usr/include/pcre/ ... not found
checking for PCRE library in /usr/pkg/ ... not found
checking for PCRE library in /opt/local/ ... not found

./configure: error: the HTTP rewrite module requires the PCRE library.
从错误信息中可用看出,需要PCRE library,搜索找到 网站: http://www.pcre.org/,或可在 http://sourceforge.net/projects/pcre/ 处下载其源码,解压,并到代码目录下执行配置,编译,安装:
./configure
make
make install
成功之后,再次运行Openresty的./configure --with-luajit,发现还是需要library:
checking for OpenSSL library ... not found
./configure: error: SSL modules require the OpenSSL library.
这次是Openssl库没有,到 http://www.openssl.org/source/下载最新源码,由于网络原因,我只能下载到openssl-0.9.8y,然后还是配置、编译、安装三部曲,OK。之后继续我们的 ./configure --with-luajit,但是我很无奈的发现还是报错说"checking for OpenSSL library ... not found",于是我只好直接指定配置路径:openssl-0.9.8y
这样可以找到openssl了,下一个库是zlib,同样手法,下载源码配置编译安装之,好了之后,再执行上面的命令,Openresty配置终于成功了。
./configure --with-luajit --with-openssl=../openssl-0.9.8y

3.编译安装

运行make 和 make install来编译安装,一次通过了。此时,我的系统中已经安装好了Openresty,因为在配置时使用了默认安装路径,所以我的程序被安装到了/usr/local/openresty/中,该文件夹中包含了luajit、lualib、nginx三个目录。

4.运行nginx

进入/usr/local/openresty/nginx/sbin目录,执行

./nginx
没出错的话,nginx就运行起来了。


转载于:https://my.oschina.net/timingbob/blog/172843

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值