CentOS编译安装openresty、rpm安装openresty、gcc gcc-c++

openresty 编译安装

  • openresty一般是编译安装的, 需要较新的gcc gcc-c++等

    1. 通过yum安装环境命令:
      yum install -y unzip make gcc gcc-c++ readline-devel pcre-devel openssl-devel perl gd-devel
    2. 编译命令:
      ./configure --with-luajit --with-http_image_filter_module --prefix=/usr/local/openresty
    3. 安装命令:
     ```
     make 
     chmod +x build/install
     make install
     ```
    
    1. 把lua.zip解压到/usr/local/share
     ```
     mv lua.zip /usr/local/share
     cd /usr/local/share
     unzip lua.zip
     ```
    
    1. 把http_headers.lua、http.lua和jit-uuid.lua放置在/usr/local/openresty/lualib/resty中
     ```
     mv http_headers.lua /usr/local/openresty/lualib/resty
     mv http.lua /usr/local/openresty/lualib/resty
     mv jit-uuid.lua /usr/local/openresty/lualib/resty
     ```
    
    1. 根据设计方案修改配置文件 配置文件一般包括 nginx.conf、_location.conf、stream.conf、ide_location.conf和ide_location.conf。(如果采用粘贴复制的方式,特别要注意location.conf和ide_location.conf中有没有直接写IP地址),注意microserver.lua和microserver_bycode.lua都需要修改IP地址
    cp nginx.conf /usr/local/openresty/nginx/conf/
    cp -r scripts /usr/local/openresty/nginx/
    
    1. 启动openresty
    ```
    #测试配置是否正确
    /usr/local/openresty/nginx/sbin/nginx -t
    #启动
    /usr/local/openresty/nginx/sbin/nginx
    #重载配置
    /usr/local/openresty/nginx/sbin/nginx -s reload
    ```
    

openresty rpm方式安装

  • openresty rpm方式安装
1. 准备好rpm包
`
   openresty-1.13.6.2-1.el7.centos.x86_64.rpm  
   openresty-openssl-1.1.0k-1.el7.x86_64.rpm  
   openresty-pcre-8.42-1.el7.centos.x86_64.rpm  
   openresty-zlib-1.2.11-3.el7.centos.x86_64.rpm`
3.  运行命令 `rpm -ivh --force openresty-*.rpm`
4. 接下来如同编译方式的4-7步骤,在此不再详述了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值