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.17.8.1rc1.tar.gz -O -|tar xz cd openresty-1.17.8.1rc1 #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 ../ ./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 --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 --with-http_sub_module gmake gmake install wget http://dl.kvm.la/conf/nginx.init -O /etc/init.d/nginx chmod 755 /etc/init.d/nginx chkconfig --add nginx chkconfig --level 235 nginx on
# cat /usr/lib/systemd/system/openresty.service [Unit] Description=The OpenResty Application Platform After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/var/run/nginx.pid ExecStartPre=/usr/sbin/nginx -t ExecStart=/usr/sbin/nginx ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
none