ngx_openresty安装笔记

系统
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise




下载地址
https://openresty.org/en/download.html
文档
https://openresty.org/en/installation.html




前提安装
You should have perl 5.6.1+, libreadline, libpcre, libssl installed into your system. For Linux, you should also ensure that ldconfig is in your PATH environment.
apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential curl


还有可能出现找不到库的情况可以先下载下来
wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
tar -zvxf openssl-1.0.2j.tar.gz
cd openssl-1.0.2j/
patch -p1 < /path/to/openresty/patches/openssl-1.0.2h-sess_set_get_cb_yield.patch
cd ..


wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
tar -xvf pcre-8.39.tar.gz




选择版本开装
wget http://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz
tar -zxvf ngx_openresty-1.9.7.2.tar.gz
cd ngx_openresty-1.9.7.2/
./configure --prefix=/home/resty/openresty \
--with-luajit \
--with-pcre-jit \
--with-ipv6 \
--without-http_redis2_module \
--with-http_iconv_module \
--with-ld-opt="-L /usr/local/lib" \
-j2


make
出现错误undefined reference to `pcre_free_study'
在末尾加上 --with-ld-opt="-L /usr/local/lib", 这个路径是pcre的安装路径。
还有另外一种方式,是使用源码,在后面加上:
--with-pcre=../pcre-8.39 --with-pcre-jit
pcre-8.39为pcre的源码


make install


启动
/home/resty/openresty/nginx/sbin/nginx -p /home/resty/openresty/nginx/conf/nginx.conf

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值