Skip to content
Snippets Groups Projects
README.md 2.33 KiB
Newer Older
Zhang Huanjie's avatar
Zhang Huanjie committed
### CentOS 6.10 编译nginx

CentOS 最小安装
yum update
reboot
yum -y install gcc pcre-devel openssl-devel libxslt-devel libxml2 gd-devel geoip-devel rpm-build rpmdevtools

cd /root/rpmbuild/SPECS
rpmbuild -bb LuaJIT.spec
rpmbuild -bb LuaJIT.spec




wget http://nginx.org/download/nginx-1.14.2.tar.gz
wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz
lget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.13.tar.gz

tar zxvf nginx-1.14.1.tar.gz
tar zxvf openssl-1.1.1.tar.gz
tar zxvf v0.3.0.tar.gz
tar zxvf v0.10.13.tar.gz

tar zxvf LuaJIT-2.0.5.tar.gz
cd LuaJIT-2.0.5
make
make install

export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0
echo "/usr/local/lib" > /etc/ld.so.conf.d/luajit.conf
ldconfig

cp nginx-1.14.1


./configure --prefix=/usr/local/nginx --with-openssl=/usr/src/openssl-1.1.1  \
--add-module=/usr/src/lua-nginx-module-0.10.13 \
--add-module=/usr/src/ngx_devel_kit-0.3.0 \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi \
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx \
--user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module \
--with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic \
--with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module \
--with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module \
--with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module \
--with-http_slice_module --with-http_stub_status_module --with-mail=dynamic --with-mail_ssl_module \
--with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-debug \
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=' -Wl,-E'

cp objs/nginx /usr/local/nginx/sbin/