执行如焉命令安装Nginx源。
[root@localhost ~] rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
使用 yum 命令安装 Ngnix
[root@localhost ~] yum install nginx
配置开机启动与启动
[root@localhost ~] systemctl enable nginx
[root@localhost ~] systemctl start nginx
启动nginx
[root@localhost ~] nginx
测试 Nginx 配置是否正确
[root@localhost ~] nginx -t
重启 Nginx
[root@localhost ~] nginx -s reload