微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

OpenResty安装Centos7.2

下载、解压安装包

[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

原文地址:https://www.jb51.cc/centos/375480.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。