# 创建www组与www用户 groupadd www useradd -g www -s /usr/sbin/nologin www # 安装nginx所需的程序库 cd /usr/local/src tar zxvf pcre-7.9.tar.gz cd pcre-7.9/ ./configure make && make install cd ../ # 安装Nginx tar zxvf nginx-0.8.15.tar.gz cd nginx-0.8.15/ ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module make && make install 启动Nginx /usr/local/nginx/sbin/nginx 测试配置文件是否正确 /usr/local/nginx/sbin/nginx -t 关闭nginx killall nginx