# nginx基础部署
apt-get update
useradd www -s /sbin/nologin -M -u 888
apt-get install --force-yes -y gcc g++ libpcre3 libpcre3-dev openssl libssl-dev libpcrecpp0 zlib1g-dev libperl-dev build-essential
mkdir -p /data/tools
cd /data/tools
wget http://nginx.org/download/nginx-1.6.3.tar.gz
tar -zxf nginx-1.6.3.tar.gz
cd nginx-1.6.3
./configure --user=www --group=www --prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_realip_module
make && make install
egrep -v "#|^$" /usr/local/nginx/conf/nginx.conf.default > /usr/local/nginx/conf/nginx.conf
启动服务需要在指定安装目录下:
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx
![](https://box.kancloud.cn/e024bbdcad4b3ea471e27e745863e2f0_415x296.png)