1.首先阿里云里面添加一条A记录
2.修改,/etc/httpd/conf/httpd.conf 文件,添加虚拟配置(修改的时候一步到位到最后一行的命令是:shift+g)
<VirtualHost *:80>
DocumentRoot /var/www/html/project/test1
ServerName test.xxxx.com
</VirtualHost>
3.修改, /etc/hosts文件,
127.0.0.1 test.xxxx.com
4.重启httpd服务
systemctl restart httpd
网友评论