1.安装nginx,并访问主机地址查看效果
yum install epel-release -y yum -y install nginx systemctl start nginx.service 访问ip地址
2.创建index.html目录,配置nginx并重启服务
创建虚拟主机根目录 mkdir -p /var/www/juna3066.com/public_index/ vim /var/www/juna3066.site/public_html/index.html 编写 配置nginx vim /etc/nginx/conf.d/virtual.conf server{ listen 80; server_name www.juna3066.site; root /var/www/juna3066.site/public_html/ index index.html } 确认配置是否正确 nginx -t
重启服务 systemctl restart nginx.service