1. 程式人生 > >OpenResty安裝(Centos7.2)

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

        若有類似如下程序,則啟動成功。