nginx yum命令安装
默认情况Centos7中没有Nginx的源,Nginx官方提供了源,所以执行如下命令添加源
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
安装Nginx
yum install -y nginx
启动Nginx并设置开机自动运行
systemctl start nginx.service
systemctl enable nginx.service
Nginx关闭命令
systemctl stop nginx.service
Nginx重启命令
systemctl restart nginx.service
关闭防火墙
systemctl stop firewalld 临时关闭
systemctl disable firewalld ,然后reboot 永久关闭
systemctl status firewalld 查看防火墙状态。
输入IP测试:
查看安装目录
有些兄弟不会看安装目录,直接查找即可;
find / -name nginx
/etc/nginx下就是;
上一篇:Keepalived简介
下一篇:Keepalived安装