Appearance
CentOS 8上安装Nginx
date: 2020-04-30 16:46:12 tags: [linux,nginx]
准备
确保有sudo权利
bash
$ sudo -l查看80端口占用情况
bash
$ netstat -tulpn | grep :80安装
安装nginx
bash
$ sudo yum install -y nginx启动nginx服务器
bash
$ sudo systemctl enable nginx启动nginx, 启动后就可以通过IP访问了
bash
$ sudo systemctl start nginx查看启动状态
bash
$ sudo systemctl status nginx常用命令
停止nginx
bash
$ sudo systemctl stop nginx重新启动
bash
$ sudo systemctl start nginx默认html文件位置
/usr/share/nginx/html
配置文件地址
/ect/nginx/nginx.conf
重新加载配置文件
bash
$ nginx -s reload