-----------------------------------------------Niginx-----------------------------------------------------
1、终端中输入:whereis nginx
(/usr/local/nginx/sbin)
2、cd /usr/local/nginx/sbin
3、启动 ./nginx
4、查看Nginx的版本号:nginx -V
5、停止 nginx -s stop
6、退出 nginx -s quit
7、重启加载配置 nginx -s reload
启动:
cd /usr/local/nginx/sbin
./nginx
查看进程:
[root@localhost nginx]# ps -ef | grep nginx
root 6142 1 0 02:27 ? 00:00:00 nginx: master process ./nginx
nobody 6143 6142 0 02:27 ? 00:00:00 nginx: worker process
root 17265 1550 0 05:14 pts/0 00:00:00 grep --color=auto nginx
查看配置文件:
[root@localhost conf]# cd /usr/local/nginx/conf
[root@localhost conf]# vi nginx.conf
server {
listen 80;
server_name localhost;
访问Niginx主页 http://192.168.231.138/
或者 curl 192.168.231.138:80