ngx_openresty安装笔记,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

相关内容

    暂无相关文章