首先通过命令安装三个依赖包
apt-get install libpcre3-dev
apt-get install libssl-dev
apt-get install make
新建用户组
groupadd www
useradd -g www www
首先解压
tar -xzvf nginx-1.2.5.tar.gz
进入目录
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_stub_status_module
make
make install
然后启动nginx
/usr/local/nginx/sbin/nginx
重启命令
/usr/nginx/sbin/nginx -s reload
测试配置是否正常
[root@linux-1 conf]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
############################以上说明配置正确###################