CentOS-6.6-x86_64源码包安装nginx-1.8.0

一、安装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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容