1、nginx要支持ssl需要下载源码,进行编译安装。
源码下载地址:http://hg.nginx.org/nginx/branches
2、建立用户
建立nginx 组
groupadd -r nginx
useradd -s /sbin/nologin -g nginx -r nginx
id nginx
3、tar -zxvf nginx-1.2.8.tar.gz
4、cd nginx-1.2.8
5、./auto/configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx/nginx.pid \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
--with-http_stub_status_module
6、make && make install
7、如果报告缺少pcre library (centos 6)
8、 检查pcre库
#rpm -qa | grep pcre
#cp /lib/libpcre.so.0 /
#rpm -e --nodeps pcre
# tar zxvf pcre-pcre-8.30.tar.gz
#cd pcre-8.30
#cp /libpcre.so.0 /lib/
#./configure
#make
#make install
检查是否安装完好: pcregrep -V