openEuler系统安装openresty1.25.3.1

本文是我在openEuler系统下安装openresty的过程,仅供参考

1、下载

离线下载地址:https://openresty.org/download
我是在线下载的,放到了/usr/local

cd /usr/local
wget https://openresty.org/download/openresty-1.25.3.1.tar.gz
# 安装openresty需要的库(这里好像不需要安装也可以,我的提示都已经存在了)
sudo yum update
sudo yum install -y yum-utils gcc curl make openssl-devel pcre-devel zlib-devel libunwind libunwind-devel libicu-devel

2、安装

cd /usr/local
#解压
tar -zxvf openresty-1.25.3.1.tar.gz
#编译和安装
cd openresty-1.25.3.1

./configure
gmake 
gmake install

此时安装完成,会出现/usr/local/openresty这个目录,即主目录
/usr/local下的openresty解压目录可以删掉:rm -rf openresty-1.25.3.1

#查看版本号:
cd /usr/local/openresty/nginx/sbin
./nginx -v

在这里插入图片描述

目录结构如下图所示:
在这里插入图片描述

3、启动

cd /usr/local/openresty/nginx/sbin
./nginx

访问地址:http://ip地址
在这里插入图片描述

出现上图说明启动成功
如果访问不到,有可能是防火墙没有开放80端口

# 查看防火墙的状态
firewall-cmd --list-all

在这里插入图片描述
如果没有80端口,就开放一下80端口,如下

firewall-cmd --permanent --add-port=80/tcp

firewall-cmd --reload 

再重新访问http://ip地址,就可以看到界面了

4、其他重要配置

隐藏版本号:为避免暴露信息,一般会对nginx进行隐藏版本号,配置如下

http {  
    ...  
    server_tokens off;  
    ...  
    server {  
        ...  
    }  
    ...  
}

上一篇:ubuntu系统安装openresty1.25.3.1

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值