1. 解压nginx其他模块
解压后是一个nginx文件夹
cd nignx
./dir_list.sh
2. 安装依赖
yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel pcre-devel gcc gcc-c++
3. 解决已知存在的问题
cd LuaJIT-2.0.2
make && make install
注:64位系统安装完成后或许还需要将/usr/local/lib/libluajit-5.1.so.2建立软连接到/lib64/libluajit-5.1.so.2,否则在后面nginx启动时会提示找不到依赖库。
ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2
4. 进行编译安装
cd nginx-1.6.0
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/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 --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-pcre=../pcre-8.36 --with-openssl=../openssl-1.0.1p --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 --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-debug --add-module=../echo-nginx-module-0.45 --add-module=../lua-nginx-module-0.9.4 --add-module=../redis2-nginx-module-0.10/ --add-module=../ngx_cache_purge-2.3 --add-module=../ngx_slowfs_cache-1.9 --add-module=../ngx_devel_kit-0.3.0 --add-module=../nginx-uuid4-module-master
make && make install
5. 此文档适用环境,已知的运行环境
centos6.5
6. 安装包下载地址
链接: https://pan.baidu.com/s/1i5fnfj3 密码: fcyy