CentOS安装OpenResty

参考文档:openresty.org/cn/installa…html

OpenResty的安装过程比较简单,官方文档也已经讲得很详细了,这里主要是作一下安装记录nginx

一、安装

# 下载
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
# 安装依赖库
yum install pcre-devel openssl-devel gcc curl
# 解压
tar -zxvf openresty-1.13.6.2.tar.gz
cd openresty-1.13.6.2/
# 配置(检测环境、生成Makefile、为编译作准备)
./configure
# 编译
make
# 安装
make install
复制代码

主要注意两点:redis

  • 安装前须要准备依赖库shell

  • ./configurevim

    默认 --prefix=/usr/local/openresty,程序会被安装到/usr/local/openresty目录bash

    能够本身指定各类选项,好比markdown

    ./configure --prefix=/opt/openresty \
                --with-luajit \
                --without-http_redis2_module \
                --with-http_iconv_module \
                --with-http_postgres_module
    复制代码

    使用 ./configure --help 查看更多的选项curl

    ./configure运行出错能够到build/nginx-1.13.6.2/objs/autoconf.err 查看oop

二、启动

配置环境变量
shell> vim /etc/profile
复制代码

添加一行post

export PATH=/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:$PATH
复制代码
shell> source /etc/profile
复制代码
启动
shell> nginx -c /usr/local/openresty/nginx/conf/nginx.conf
复制代码
从新加载配置
shell> nginx -s reload
复制代码

三、测试

相关文章
相关标签/搜索