CentOS 安裝 OpenResty,centosopenresty

來源:互聯網
上載者:User

CentOS 安裝 OpenResty,centosopenresty

1、在 CentOS 系統中添加 openresty 資產庫
sudo yum-config-manager --add-repo https://openresty.org/yum/cn/centos/OpenResty.repo

2、安裝 openresty
sudo yum install openresty


OpenResty 是一個基於 Nginx 與 Lua 的高效能 Web 平台,其內部整合了大量精良的 Lua 庫、第三方模組以及大多數的依賴項。用於方便地搭建能夠處理超高並發、擴充性極高的動態 Web 應用程式、Web 服務和動態網關。

OpenResty 通過匯聚各種設計精良的 Nginx 模組(主要由 OpenResty 團隊自主開發),從而將 Nginx 有效地變成一個強大的通用 Web 應用程式平台。這樣,Web 開發人員和系統工程師可以使用 Lua 指令碼語言調動 Nginx 支援的各種 C 以及 Lua 模組,快速構造出足以勝任 10K 乃至 1000K 以上單機並發串連的高效能 Web 應用程式系統。

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

你可以在你的 CentOS 系統中添加 openresty 資產庫,這樣就可以方便的安裝我們的包,以後也可以更新(通過 yum update 命令)。添加資產庫,你只用建立一個名為 /etc/yum.repos.d/OpenResty.repo 的檔案,內容如下:

[openresty]
name=Official OpenResty Repository
baseurl=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/epel-$releasever-$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/openresty/openresty/pubkey.gpg
enabled=1
enabled_metadata=1

你也可以直接運行 sudo yum-config-manager --add-repo https://openresty.org/yum/centos/OpenResty.repo 添加該檔案。

中國大陸的使用者可以把 baseurl 改成下面的連結,速度會更快。

baseurl=https://openresty.org/yum/openresty/openresty/epel-$releasever-$basearch/

或者運行 sudo yum-config-manager --add-repo https://openresty.org/yum/cn/centos/OpenResty.repo 添加對應的檔案。

列出 openresty 資產庫裡面所有的包:

sudo yum --disablerepo="*" --enablerepo="openresty" list available

然後你可以安裝一個包,比如安裝 openresty, 像這樣:

sudo yum install openresty

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.