nginx常用命令
nginx启动命令:
先进sbin目录,然后 ./nginx启动
[ root @ VM _0_2_ centos conf ] # CD/usr/local/nginx /
[root@VM_0_2_centos nginx]# ls
client _ body _ tempconfastcgi _ temphtmllogsproxy _ tempsbinscgi _ tempuwsgi _ temp
[ root @ VM _0_2_ centos nginx ] # CD sbin
[root@VM_0_2_centos sbin]# ls
nginx
查看版本
[ root @ VM _0_2_ centos sbin ] #./nginx-v
nginx version: nginx/1.12.2
查看是否启动成功
[ root @ VM _0_2_ centos sbin ] # PS-ef|grepnignx
root 2169612607009336015 pts/000336000336000 grep-- color=autonignx
启动失败了。
原因是端口80被占用,nginx启动失败。
检查所有端口,杀死80端口进程
netstat -ntlp杀死80的进程,12874是进程ID
kill -9 12874之后重新启动并成功
[ root @ VM _0_2_ centos sbin ] #./nginx [ root @ VM _0_2_ centos sbin ] # PS-ef|grepnginxroot 2220093366936660 0:00:00 nginx :00 workerprocessroot 2264512607009336044 pts/000336000 grep-- color=auto nginx http://ww.singinging
./nginx -s reload