1,下载nginx安装包
wget http://nginx.org/download/nginx-1.9.9.tar.gz
2,解压安装包
tar -zxvf nginx-1.9.9.tar.gz
3,指定安装目录,并生成编译文件
./configure --prefix=/usr/local/nginx
4,编译和安装nginx
make && make install
5,启动nginx
[root 22:39:44 /usr/local/nginx/sbin
$ ./nginx
6,查看nginx运行状态
[root 22:40:18 /usr/local/nginx1/sbin
$ ps aux|grep nginx
root 4004 0.0 0.0 24896 764 ? Ss 22:40 0:00 nginx: master process ./nginx
nobody 4005 0.0 0.0 27392 1528 ? S 22:40 0:00 nginx: worker process
root 4036 0.0 0.0 112712 964 pts/0 S+ 22:40 0:00 grep --color=auto nginx