1.nginx与依赖库下载 nginx下载地址: http://nginx.org/ pcre(Perl Compatible Regular Expressions)下载地址: http://www.pcre.org/ https://sourceforge.net/projects/pcre/files/pcre/ zlib下载地址: http://www.zlib.net/
2.安装pcre: # tar zxvf pcre-8.35.tar.gz # cd pcre-8.35 #./configure -prefix=/usr/local/pcre # make # make install
3.安装zlib: # tar zxvf zlib-1.2.8.tar.gz # cd zlib-1.2.8 #./configure -prefix=/usr/local/zlib # make # make install
4.安装nginx: # tar -zxvf nginx-1.6.0.tar.gz # cd nginx-1.6.0 # ./configure --prefix=/usr/local/nginx # make # make install
5.运行nginx,默认的端口是80. # cd /usr/local/nginx # ./nginx # ./nginx -s reload # ./nginx -s stop
测试nginx,在浏览器输入: http://localhost