Centos的openresty安装记录

以下是自用的openresty编译归纳

yum安装常用包

yum -y update
yum -y install epel-release -y
yum install lua-devel luajit git dos2unix mercurial -y
yum -y --skip-broken install gcc  vim-enhanced gcc-c++ libtool-libs libtool autoconf subversion zip unzip  wget crontabs iptables file bison patch mlocate flex diffutils automake imake make cmake cpp unix2dos mercurial kernel-devel zlib-devel

编译安装pcre

cd /tmp
wget -c http://sourceforge.net/projects/pcre/files/pcre/8.21/pcre-8.21.tar.gz/download -O -|tar xz
cd pcre-8.21 && ./configure
make && make install
if [ `uname -i` == x86_64 ]; then ln -s /usr/lib64/{libpcre.*,libjpeg.so,libpng.so,libXpm.so,libc-client.so,libkrb5.so,libexpat.so,libevent.so} /usr/lib/;fi

编译安装openresty

wget https://openresty.org/download/openresty-1.15.6.1rc0.tar.gz -O -|tar xz
cd openresty-1.15.6.1rc0
#wget -c https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.8.2.tar.gz -O -|tar xz && mv libressl-* libressl
git clone https://github.com/libressl-portable/portable  libressl
cd libressl && ./autogen.sh
cd ../
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module
./configure --prefix=/etc --sbin-path=/usr/sbin/nginx --pid-path=/var/run/nginx.pid  --conf-path=/etc/nginx/nginx.conf --lock-path=/var/lock/subsys/nginx --with-stream=dynamic   --with-stream_ssl_module   --with-stream_realip_module --with-stream_ssl_preread_module  --with-mail=dynamic --with-mail_ssl_module --with-openssl=libressl --with-http_v2_module --with-pcre --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module  --with-http_secure_link_module --with-http_dav_module  --with-http_ssl_module --add-module=ngx_http_substitutions_filter_module
make -j2
make install
 wget http://dl.kvm.la/conf/nginx.init -O /etc/init.d/nginx
 chmod 755 /etc/init.d/nginx
 chmod 755 /etc/init.d/nginx
chkconfig --add nginx
chkconfig --level 235 nginx on


添加新评论 »