安装和配置nginx

web服务器nginx和apache的对比分析

yum -y install  gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses* libmcrypt* 

./configure --user=nginx --group=nginx --prefix=/usr/local/nginx/ --with-http_stub_status_module --with-http_ssl_module
配置nginx
 ./configure --prefix=/usr/local/nginx --with-http_stub_status_module

解释: --prefix 为安装路径,--with-为需要安装的模块,具体可以运行./configure --help 查看有效模块

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre= option

yum -y install  *pcre*

make

make install

v-lhb-web01:/root/nginx-1.7.7# /usr/local/nginx/sbin/nginx 
v-lhb-web01:/root/nginx-1.7.7# 
v-lhb-web01:/root/ng

你可能感兴趣的:(nginx)