OpenResty是一個全功能的 Web 應用服務器。它打包了標准的 Nginx 核心,常用的第三方模塊以及大多數依賴項。 可以把它看成是Nginx附加眾多的第三方插件的合集。其主體是嵌入lua腳本的支持,讓你能夠使用lua靈活地處理運算邏輯。
1、Openresty的安裝配置
1.1、簡易的yum安裝方式
此方式簡單,缺點是無法干預啟停插件
yum install yum-utils
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
yum install openresty
1.2、源碼安裝方式
默認, --prefix=/usr/local/openresty 程序會被安裝到/usr/local/openresty目錄(當時安裝完找半天找不到在哪,結果看官方文檔說會默認安裝到/usr/local/openresty目錄,如果需要指定目錄可以去看官方文檔:http://openresty.org/cn/installation.html,不過這玩意不要去改,默認就挺好的)。
wget https://openresty.org/download/openresty-1.15.8.1.tar.gz
tar -zxvf openresty-1.15.8.1.tar.gz
##選擇需要的插件啟用, --with-Components 激活組件,--without 則是禁止組件
./configure --without-http_redis2_module --with-http_iconv_module
##默認, --prefix=/usr/local/openresty 程序會被安裝到/usr/local/openresty目錄。
make && make install
## 配置環境變量
vi /etc/profile ##加入path路徑
export PATH=$PATH:/usr/local/openresty/nginx/sbin/
source /etc/profile ##生效配置
啟停命令:
./nginx -c nginx.conf的文件。如果不指定,默認為NGINX_HOME/conf/nginx.conf
./nginx -s stop 停止
./nginx -s quit退出
./nginx -s reload 重新加載nginx.conf
————————————————
版權聲明:本文為CSDN博主「有頭發的猩猩」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/m0_37574389/article/details/98873899