一、安装Nginx
1. pcre: 支持正则表达式,地址重写rewrite
# tar xvfpcre-8.10.zip
# cd pcre-8.10
# ./configure --prefix=/usr/local/pcre-8.10
make && make install
2. Nginx:
# yum -y install openssl openssl-devel
#su root
#123456
# groupadd www
# useradd -g www www
# tar xf nginx-1.4.4.tar.gz
# cd nginx-1.4.4
#
./configure \
--prefix=/usr/local/nginx-1.8.0\
--user=www \
--group=www \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-pcre=/usr/local/src/pcre-8.10
(注意这是源文件地址,而不是安装文件地址)
# make &&make install
# /usr/local/nginx-1.8.0/sbin/nginx
# netstat -tnlp |grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 11051/nginx
# elinks -dump http://localhost
Welcome to nginx!
# echo "/usr/local/nginx-1.8.0/sbin/nginx" >> /etc/rc.local