0%

nginx安装

添加nginx的源

1
[root@localhost yum.repos.d]# rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

安装nginx

1
sudo yum -y install nginx   # 安装 nginx

nginx的使用命令

1
2
3
4
5
6
systemctl status nginx
systemctl restart nginx
systemctl start nginx
systemctl stop nginx
systemctl enable nginx // 开机启动
systemctl reload nginx // 重新加载配置

nginx的配置文件目录

1
cd /etc/nginx

nginx 的web访问目录

1
cd /usr/share/nginx/html

-------------本文结束感谢你的阅读---------