1. 程式人生 > >centos7安裝openresty1.15

centos7安裝openresty1.15

介紹
OpenResty目標是讓你的Web服務直接跑在 Nginx 服務內部,充分利用 Nginx 的非阻塞 I/O 模型,不僅僅對 HTTP 客戶端請求,甚至於對遠端後端諸如 MySQL、PostgreSQL、Memcached 以及 Redis 等都進行一致的高效能響應。

下載地址
https://openresty.org/en/download.html

wget https://openresty.org/download/openresty-1.15.8.1.tar.gz

安裝所需依賴包
yum -y install readline-devel pcre-devel openssl-devel gcc perl curl

編譯安裝
解壓壓縮包
tar zxvf openresty-1.15.8.1.tar.gz

進入資料夾
cd openresty-1.15.8.1

編譯

./configure --prefix=/usr/local/webservice/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module

編譯&編譯安裝
gmake & gmake install

配置
啟動Nginx,載入nginx主配置檔案
/usr/local/webservice/openresty/nginx/sbin/nginx -t -c /usr/local/webservice/openresty/nginx/conf/nginx.conf

啟動openresty
cd /usr/local/webservice/openresty/nginx/sbin
./nginx -s quit 停止
./nginx 啟動
./nginx -s reload 重新載入配置檔案

配置環境變數
vim ~/.bash_profile
最後加上

export PATH=/usr/local/webservice/openresty/bin:/usr/local/webservice/openresty/nginx/sbin:$PATH
1
source ~/.bash_profile

確證是否安裝成功
使用nginx -t確認
nginx -v
nginx -s reload
 ———————————————— 
版權宣告:本文為CSDN博主「gusijin」的原創文章,遵循CC 4.0 by-sa版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/gusijin/art