当前位置: 首页 > article >正文

linux安装OpenResty

1、安装开发库

yum install -y pcre-devel openssl-devel gcc --skip-broken

2、安装OpenResty仓库

yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo

3、安装OpenResty

yum install -y openresty

4、安装opm工具

yum install -y openresty-opm

5、默认情况下,OpenResty安装的目录是:/usr/local/openresty

6、配置nginx的环境变量

vi /etc/profile

7、在最下面加入两行:

export NGINX_HOME=/usr/local/openresty/nginx
export PATH=${NGINX_HOME}/sbin:$PATH

8、退出ESC 保存:wq 生效

source /etc/profile

9、常见命令

# 启动nginx
nginx
# 重新加载配置
nginx -s reload
# 停止
nginx -s stop

10、修改nginx.conf文件

/usr/local/openresty/nginx/conf/nginx.conf

#user  nobody;
worker_processes  1;
error_log  logs/error.log;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       8012;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

11、启动

nginx

12、访问

http://自己的ip:8012


http://www.kler.cn/a/577936.html

相关文章:

  • 编译Telegram Desktop
  • hbase的主要功能
  • 树莓派5首次开机保姆级教程(无显示器通过VNC连接树莓派桌面)
  • 源码:用Python进行电影数据分析实战指南
  • Monica国内版深度测评:全能AI助手如何重塑你的智能生活?
  • Refreshtoken 前端 安全 前端安全方面
  • 国产FPGA往事
  • [数字图像处理]实验三:直方图增强
  • Linux的OOM Killer
  • 解决Node Electron下调用Python脚本输出中文乱码的问题
  • vue和easyui渲染问题
  • 前端知识点---http.createHttp()的理解(arkts)
  • 求职面试常见问题:数组与链表
  • 【Linux内核系列】:深入解析输出以及输入重定向
  • 基于 ChatGPT 创建专属 GPTs
  • flink集成tidb cdc
  • 理解Java泛型通配符:List<? extends T>与List<? super T>的深度解析
  • Django模型数据修改:详解两种方式
  • 阿里巴巴全新推理模型QwQ-32B:性能比肩DeepSeek-R1,开源引领未来
  • 文本处理Bert面试内容整理-BERT的优点是什么?