ubuntu安装OpenResty
时间: 2023-11-06 07:01:24 浏览: 69
要在Ubuntu上安装OpenResty,您可以按照以下步骤进行操作。首先,打开终端并输入以下命令以添加OpenResty的软件源:
```
echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list
```
然后,更新软件包列表并安装OpenResty:
```
sudo apt-get update
sudo apt-get -y install openresty
```
如果您使用的是ARM64架构的Ubuntu系统,可以使用以下命令添加相应的软件源:
```
echo "deb http://openresty.org/package/arm64/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list
```
接下来,再次运行更新命令并安装OpenResty:
```
sudo apt-get update
sudo apt-get -y install openresty
```
完成以上步骤后,您的Ubuntu系统上就安装好了OpenResty。
相关问题
ubuntu 卸载 openresty
要在Ubuntu上卸载OpenResty,您可以按照以下步骤进行操作:
1. 打开终端。
2. 输入以下命令以停止OpenResty服务:
```
sudo systemctl stop openresty
```
3. 输入以下命令以卸载OpenResty:
```
sudo apt remove openresty
```
4. 在卸载过程中,系统会提示您确认卸载。输入密码并按下Enter键。
5. 等待卸载完成。
6. 输入以下命令以清理残留的配置文件:
```
sudo apt autoremove
```
这样就完成了OpenResty的卸载。请注意,这些步骤将卸载OpenResty及其相关组件和配置文件。
怎么确认openresty是安装了luajit
要确认 OpenResty 是否安装了 LuaJIT,可以通过以下两种方法进行:
1. 查看 OpenResty 版本信息
打开终端,输入 `openresty -v` 命令,查看 OpenResty 的版本信息:
```
$ openresty -v
nginx version: openresty/1.19.9.1
built by gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
built with OpenSSL 1.1.1g 21 Apr 2020
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-http_ssl_module --with-http_v2_module --with-openssl=/usr/local/src/openssl-1.1.1g --with-pcre=/usr/local/src/pcre-8.44 --with-pcre-jit --with-cc-opt='-O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.19.9/debian/debuild-base/nginx-1.19.9=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
```
如果在命令输出中看到 `built with LuaJIT` 字样,则表示 OpenResty 是使用 LuaJIT 编译的,已经安装了 LuaJIT。
2. 查看 OpenResty Lua 模块
打开终端,输入 `openresty -V` 命令,查看 OpenResty 编译时开启的 Lua 模块:
```
$ openresty -V
openresty version: openresty/1.19.9.1
built by gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
built with OpenSSL 1.1.1g 21 Apr 2020
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-http_ssl_module --with-http_v2_module --with-openssl=/usr/local/src/openssl-1.1.1g --with-pcre=/usr/local/src/pcre-8.44 --with-pcre-jit --with-cc-opt='-O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.19.9/debian/debuild-base/nginx-1.19.9=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
```
如果在命令输出中看到 `--with-luajit` 或者 `--with-lua` 字样,则表示 OpenResty 安装了 LuaJIT。其中,`--with-luajit` 表示使用 LuaJIT 编译,`--with-lua` 表示使用官方 Lua 编译。如果两个选项都没有出现,则表示 OpenResty 没有安装 LuaJIT。