1. 安装
yum -y install nginx
2. 查看安装目录
whereis nginx
执行目录:/usr/sbin/nginx
模块所在目录:/usr/lib64/nginx/modules
配置所在目录:/etc/nginx/
默认站点目录:/usr/share/nginx/html
主要配置文件:/etc/nginx/nginx.conf 指向:/etc/nginx/conf.d/default.conf
PID目录:/var/run/nginx.pid
错误日志:/var/log/nginx/error.log
访问日志:/var/log/nginx/access.log
3. 常用命令
# 启动
systemctl start nginx.service
# 开机启动
systemctl enable nginx.service
# 停止
systemctl stop nginx.service
# 重启
systemctl reload nginx.service
# 状态
systemctl status nginx.service