本文为学习笔记
安装相关依赖
yum install yum-utils -y
yum-config-manager --add-repo [https://openresty.org/package/centos/openresty.repo](https://openresty.org/package/centos/openresty.repo)
yum install openresty –y
yum install openresty-resty -y
yum --disablerepo="*" --enablerepo="openresty" list available
yum install pcre-devel openssl-devel gcc curl
下载环境
image.png
解压上传
/usr/local
编译
cd /usr/local/openresty-1.17.8.2
./configure
make
make install
启动 Nginx
- 安装完成之后,nginx默认安装在 /usr/local/openresty/nginx目录下
cd /usr/local/openresty/nginx
#启动nginx
/usr/local/openresty/nginx/sbin/nginx
# 重启nginx
/usr/local/openresty/nginx/sbin/nginx -s reload
修改防火墙
- 如若需要外部连接则需要修改防火墙
- 或者设置指定地址允许通过防火墙
- 这里(个人)选择禁止防火墙
#禁用防火墙
systemctl stop firewalld.service
#禁止防火墙开机启动
systemctl disable firewalld.service
image.png
网友评论