1.环境参数:Linux:Centos6.5,Nginx:1.6.3
2.Nginx下载,下载地址:wget http://nginx.org/download/nginx-1.6.3.tar.gz
3.依赖安装
yum install pcre pcre-devel openssl openssl-devel -y
4.创建Nginx用户和组
groupadd nginx
useradd nginx -s /sbin/nologin -M -g nginx
5.解压Nginx
tar xf nginx-1.6.3.tar.gz
cd nginx-1.6.3
6.编译软件
./configure \
--user=nginx \
--group=nginx \
--prefix=/application/nginx1.6.3 \
--with-http_stub_status_module \
--with-http_ssl_module
7.安装软件
make && make install
8.做软连接
ln -s /application/nginx1.6.3/ /application/nginx
9.Nginx的启动
/application/nginx/sbin/nginx
10.Nginx停止和重启
nginx -s stop
nginx -s reload
11.检查Nginx是否正确
/application/nginx/sbin/nginx -t
12.两种检查启动是否成功方法
[root@cancer nginx]# netstat -lntup|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7853/nginx
[root@cancer nginx]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 7853 root 6u IPv4 466356 0t0 TCP *:http (LISTEN)
nginx 7854 nginx 6u IPv4 466356 0t0 TCP *:http (LISTEN)
2.Nginx下载,下载地址:wget http://nginx.org/download/nginx-1.6.3.tar.gz
3.依赖安装
yum install pcre pcre-devel openssl openssl-devel -y
4.创建Nginx用户和组
groupadd nginx
useradd nginx -s /sbin/nologin -M -g nginx
5.解压Nginx
tar xf nginx-1.6.3.tar.gz
cd nginx-1.6.3
6.编译软件
./configure \
--user=nginx \
--group=nginx \
--prefix=/application/nginx1.6.3 \
--with-http_stub_status_module \
--with-http_ssl_module
7.安装软件
make && make install
8.做软连接
ln -s /application/nginx1.6.3/ /application/nginx
9.Nginx的启动
/application/nginx/sbin/nginx
10.Nginx停止和重启
nginx -s stop
nginx -s reload
11.检查Nginx是否正确
/application/nginx/sbin/nginx -t
12.两种检查启动是否成功方法
[root@cancer nginx]# netstat -lntup|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7853/nginx
[root@cancer nginx]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 7853 root 6u IPv4 466356 0t0 TCP *:http (LISTEN)
nginx 7854 nginx 6u IPv4 466356 0t0 TCP *:http (LISTEN)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29812844/viewspace-1988854/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29812844/viewspace-1988854/