欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在Debian11上安裝Openresty服務(wù)(Nginx+Lua)的詳細(xì)教程

 更新時間:2022年10月18日 16:28:33   作者:WangYongTao  
OpenResty 是一個基于 Nginx 與 Lua 的高性能 Web 平臺,其內(nèi)部集成了大量精良的 Lua 庫、第三方模塊以及大多數(shù)的依賴項,這篇文章主要介紹了在Debian11上安裝Openresty服務(wù)(Nginx+Lua)?,需要的朋友可以參考下

OpenResty 是一個基于 Nginx 與 Lua 的高性能 Web 平臺,其內(nèi)部集成了大量精良的 Lua 庫、第三方模塊以及大多數(shù)的依賴項。用于方便地搭建能夠處理超高并發(fā)、擴(kuò)展性極高的動態(tài) Web 應(yīng)用、Web 服務(wù)和動態(tài)網(wǎng)關(guān)。

OpenResty 官方 APT 包倉庫提供了 deb 包 (適用于 Ubuntu 和 Debian),可以很方便的安裝,一起來看下具體的安裝步驟吧。

Debian 更新系統(tǒng)

$ apt update
# 這一步選做
$ apt upgrade 

添加 openresty 倉庫

可以在 Debian 系統(tǒng)中添加 openresty 倉庫,這樣就可以方便的安裝或更新我們的軟件包(通過 apt update 命令)。
運(yùn)行下面的命令就可以添加我們的倉庫(每個系統(tǒng)只需要運(yùn)行一次):

步驟一:安裝導(dǎo)入 GPG 公鑰時所需的幾個依賴包(整個安裝過程完成后可以隨時刪除它們):

sudo apt -y install --no-install-recommends wget gnupg ca-certificates

步驟二:導(dǎo)入我們的 GPG 密鑰:

wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -

步驟三:添加我們官方 APT 倉庫。

對于 x86_64 或 amd64 系統(tǒng),可以使用下面的命令:

codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release`

echo $codename

echo "deb http://openresty.org/package/debian $codename openresty" \
    | sudo tee /etc/apt/sources.list.d/openresty.list

這歷史查找當(dāng)前 debian 系統(tǒng)的版本(即 $codename 變量),更加系統(tǒng)版本再配置。

root@VM-4-14-debian:/opt# codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release`
root@VM-4-14-debian:/opt# echo $codename
root@VM-4-14-debian:/opt# bullseye
root@VM-4-14-debian:/opt# echo "deb http://openresty.org/package/debian bullseye openresty" | sudo tee /etc/apt/sources.list.d/openresty.list
deb http://openresty.org/package/debian bullseye openresty

而對于 arm64 或 aarch64 系統(tǒng),則可以使用下面的命令:

codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release`

echo "deb http://openresty.org/package/arm64/debian $codename openresty" \
    | sudo tee /etc/apt/sources.list.d/openresty.list

更新APT索引并安裝

步驟四:更新 APT 索引:

sudo apt update

然后就可以像下面這樣安裝軟件包,比如 openresty:

sudo apt -y install openresty

這個包同時也推薦安裝 openresty-opm 和 openresty-restydoc 包,所以后面兩個包會缺省安裝上。

如果你不想自動關(guān)聯(lián)安裝,可以用下面方法關(guān)閉自動關(guān)聯(lián)安裝:

sudo apt -y install --no-install-recommends openresty

openresty-opm 是 OpenResty 的包管理工具(OpenResty package manager)。

查看安裝的版本:

安裝目錄: /usr/local/openresty

$ nginx -v
nginx version: openresty/1.21.4.1

$ /usr/local/openresty/nginx/sbin/nginx -v
nginx version: openresty/1.21.4.1

使用 systemctl 可以管理openresty服務(wù):

systemctl enable openresty 
systemctl status openresty 
systemctl start openresty 
systemctl stop openresty  
systemctl restart openresty 

驗證效果,通過 curl 命令請求 localhost :

root@VM-4-14-debian:~# curl -I localhost
HTTP/1.1 200 OK
Server: openresty/1.21.4.1
Date: Sun, 09 Oct 2022 14:04:10 GMT
Content-Type: text/html
Content-Length: 1097
Last-Modified: Tue, 17 May 2022 03:51:45 GMT
Connection: keep-alive
ETag: "62831bd1-449"
Accept-Ranges: bytes

也可以打開瀏覽器 ,訪問服務(wù)器ip,查看頁面驗證。

參考鏈接

https://wang123.net/a/linux-debian-install-openresty
https://openresty.org/cn/linux-packages.html

到此這篇關(guān)于在Debian11上安裝Openresty服務(wù)(Nginx+Lua)的文章就介紹到這了,更多相關(guān)Debian安裝Openresty服務(wù)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論