美文网首页
linux 搭建 OpenResty

linux 搭建 OpenResty

作者: 索性流年 | 来源:发表于2020-08-31 15:00 被阅读0次

本文为学习笔记

安装相关依赖

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

相关文章

网友评论

      本文标题:linux 搭建 OpenResty

      本文链接:https://www.haomeiwen.com/subject/dkjusktx.html