CentOS平台 OpenResty源码编译安装

安装依赖包

yum install -y make cmake gcc gcc-c++ autoconf automake libpng-devel libjpeg-devel zlib libxml2-devel ncurses-devel bison libtool-ltdl-devel libiconv libmcrypt mhash mcrypt pcre-devel openssl-devel freetype-devel libcurl-devel readline-devel curl

下载安装包

 wget https://openresty.org/download/openresty-1.11.2.5.tar.gz
 wget https://www.openssl.org/source/openssl-1.0.2g.tar.gz
 wget https://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz

解压

tar -zxvf openresty-1.11.2.5.tar.gz
tar -zxvf openssl-1.0.2g.tar.gz
tar -zxvf zlib-1.2.11.tar.gz

cp -r openssl-1.0.2g /usr/local/openssl-1.0.2g
cp -r zlib-1.2.8 /usr/local/zlib-1.2.8

安装openssl,zlib

cd /usr/local/openssl-1.0.2g
./config --prefix=/usr/local/openssl
./config -t
make && make install

cd /usr/local/zlib-1.2.11
./configure  --prefix=/usr/local/zlib
make && make install

安装配置

cd openresty-1.11.2.5
./configure --prefix=/usr/local/openresty-1.11.2.5 --with-luajit --with-stream --with-http_iconv_module --with-http_realip_module --with-ld-opt="-Wl,-rpath,/usr/local/lib"  --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-openssl=/usr/local/openssl-1.0.2g --with-zlib=/usr/local/zlib-1.2.8

安装

gmake
gmake install

错误

/bin/sh: ps2pdf: command not found
gmake[3]: *** [zlib.3.pdf] Error 127
gmake[3]: Leaving directory `/usr/local/zlib-1.2.11'
gmake[2]: *** [/usr/local/zlib-1.2.11/libz.a] Error 2
gmake[2]: Leaving directory `/data1/src/php7/openresty-1.15.8.2/build/nginx-1.15.8'
gmake[1]: *** [build] Error 2
gmake[1]: Leaving directory `/data1/src/php7/openresty-1.15.8.2/build/nginx-1.15.8'
gmake: *** [all] Error 2

解决:

yum install ghostscript

错误2

Multilib version problems found. This often means that the root
      cause is something else and multilib version checking is just
      pointing out that there is a problem. Eg.:

        1. You have an upgrade for zlib which is missing some
           dependency that another package requires. Yum is trying to
           solve this by installing an older version of zlib of the
           different architecture. If you exclude the bad architecture
           yum will tell you what the root cause is (which package
           requires what). You can try redoing the upgrade with
           --exclude zlib.otherarch ... this should give you an error
           message showing the root cause of the problem.

        2. You have multiple architectures of zlib installed, but
           yum can only see an upgrade for one of those architectures.
           If you don't want/need both architectures anymore then you
           can remove the one with the missing update and everything
           will work.

        3. You have duplicate versions of zlib installed already.
           You can use "yum check" to get yum show these errors.

      ...you can also use --setopt=protected_multilib=false to remove
      this checking, however this is almost never the correct thing to
      do as something else is very likely to go wrong (often causing
      much more problems).

      保护多库版本:zlib-1.2.7-15.el7.x86_64 != zlib-1.2.7-13.el7.i686

解决:

yum install --setopt=protected_multilib=false zlib

你可能感兴趣的:(Linux,Openresty)