debian9、Raspbian安装openresty,debian9openresty
debian9、Raspbian安装openresty,debian9openresty
Raspbian是默认的最常用于Raspberry Pi的免费操作系统。Raspbian是基于Debian的一个版本(针对Raspberry Pi硬件Debian进行了专门的优化,并构建了超过35000个Raspbian包)。
首先第一步查看当前系统所处版本:
lsb_release -a
即不难知道我们当前系统可以参照debian 9稳定系统,知道系统版本,出问题也好比较容易定位。如下图所示有个debian系统参照表:
第一步安装依赖:
apt-get install libpcre3-dev \ libssl-dev perl make build-essential curl
若执行不成功,可以尝试拆开分布执行。
第二步下载openresty安装版本:
这里我们选用2017年版:
wget --no-check-certificate https://openresty.org/download/openresty-1.13.6.1.tar.gz
tar -xvf openresty-1.13.6.1.tar.gz
安装组件:
cd openresty-1.13.6.1/bundle/LuaJIT-2.1-20171103/
make clean && make && make install
ln -sf luajit-2.1.0-alpha /usr/local/bin/luajit
当前目录回到bundle:
cd ..
wget --no-check-certificate https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz
tar -xvf 2.3.tar.gz
wget --no-check-certificate https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz
tar -xvf v0.3.0.tar.gz
安装ngx_openresty:
cd openresty-1.13.6.1
./configure --prefix=/opt/work/openresty --with-http_realip_module --with-pcre --with-luajit --add-module=./bundle/ngx_cache_purge-2.3/ --add-module=./bundle/nginx_upstream_check_module-0.3.0/ -j2 --with-openssl=/opt/work/openssl-1.0.2l
--prefix为编译安装路径,后面with-openssl主要针对debian9默认openssl安装版本不兼容openresty。
之后编译安装
make && make install
完成编译后测试:
./nginx/sbin/nginx -t
nginx: the configuration file /opt/work/openresty/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/work/openresty/nginx/conf/nginx.conf test is successful
说明安装成功。
评论暂时关闭