nginx 1.10.2 编译安装

本文详细介绍了如何从源码安装配置Nginx及其Lua模块,包括所需依赖库的安装,如lua-devel、GeoIP-devel、gcc-c++等,并配置了多个Nginx功能模块,如http_ssl_module、http_realip_module等,以及如何设置缓存目录和权限。

 

 

yum  -y install lua-devel GeoIP GeoIP-devel GeoIP-data  perl-devel perl-ExtUtils-Embed  gd-devel libxslt-devel libxml2 libxml2-dev  zlib-devel  gcc-c++ autoconf automake pcre pcre-devel 

useradd nginx -u 1001

mkdir /var/cache/nginx
chown nginx:nginx /var/cache/nginx/ -R


cd LuaJIT-2.0.3/
make install

cd GeoIP-1.4.8/
make install


./configure --group=nginx --prefix=/usr/local/nginx --add-module=../nginx-accesskey-2.0.3/ --add-module=../ngx_devel_kit-0.2.19/ --add-module=../lua-nginx-module-0.10.9rc5/ --with-http_secure_link_module --with-http_random_index_module --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-pcre=../pcre-8.35 --error-log-path=/usr/local/nginx/log/error.log --http-log-path=/usr/local/nginx/log/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --with-http_addition_module --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_stub_status_module --with-http_auth_request_module --with-mail_ssl_module --with-file-aio --with-ipv6 --add-module=../ngx_cache_purge-master --with-http_geoip_module --with-stream --with-zlib=../zlib-1.2.8/ --with-openssl=../openssl-1.0.2k/

make
make install

 

转载于:https://www.cnblogs.com/heaven-xi/articles/9982275.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值