OpenResty安装(Centos7.2)

本文详细介绍如何下载、编译并安装OpenResty及其依赖组件libpq、pcre和openssl的过程。文章还提供了启动OpenResty的方法及如何验证安装是否成功的步骤。

下载、解压安装包

[root]# wget https://openresty.org/download/openresty-1.11.2.5.tar.gz

安装libpq、pcre、openssl

libpq

[root]# yum install postgresql-devel

        如果不安装libpq,则有可能报出以下错误:

./configure: error: ngx_postgres addon was unable to detect version of the libpq library.

pcre

[root]# yum -y install pcre-devel

        如果不安装pcre,则有可能报出以下错误:

./configure: error: the HTTP rewrite module requires the PCRE library

openssl

[root]# yum -y install openssl openssl-devel 

        如果不安装openssl,则有可能报出以下错误:

./configure: error: SSL modules require the OpenSSL library.

编译安装
[root]# ./configure --prefix=/root/software/openresty \
            --with-luajit \
            --without-http_redis2_module \
            --with-http_iconv_module \
            --with-http_postgres_module
            
[root]# make & make install  

启动

[root]# ~/software/openresty/nginx/sbin/nginx -p ~/software/openresty/nginx/ -c ~/software/openresty/nginx/conf/nginx.conf

验证

[root]# ps -ef | grep nginx

        若有类似如下进程,则启动成功。



链接:http://moguhu.com/article/detail?articleId=54

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值