1、首先yum安装
yum install nginx
2、检查安装是否成功
nginx -v
3、查看安装目录
rpm -ql nginx
4、运行起来,就可以直接输入ip地址查看了,端口默认是80
sudo service nginx start
5、nginx默认配置文件的路径
/usr/local/nginx/nginx-1.13.7/conf
或者
/etc/nginx/nginx.conf
注意:如果出现修改配置文件不生效问题就启动时候就加参数来读取此配置文件,不然回去读取/etc/nginx目录下的文件,可以使用 nginx -t 来查看使用的配置文件目录。但是我发现加 -c 并没有卵用,最后是把配置文件移动到/etc/nginx目录下的.....
/usr/local/nginx/nginx-1.13.7/conf -c nginx.conf
停止nginx:nginx.exe -s stop
重新加载:nginx.exe -s reload
退出:nginx.exe -s quit