1.进入阿里云控制台->域名->云解析DNS
2.点击解析设置
3.添加解析
4.按要求填写
5.这里域名就已经解析好的,然后开始下一步,进入/etc/httpd/conf/httpd.conf
6.找到这行 DocumentRoot "erroy.cn",屏蔽它,并保存
7.在/etc/httpd/conf.d目录下 创建一个文件 virtualhost.conf(名字可以随意英文)
8.virtualhost.conf文件内容为
<VirtualHost *:80>
ServerAdmin 634800255@qq.com
ServerName ysw.erroy.cn
DocumentRoot "/home/www/ysw.erroy.cn"
DirectoryIndex index.php
CustomLog logs/ysw.erroy.log combined
<Directory "/home/www/ysw.erroy.cn">
Options -Indexes +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
9.重启httpd service httpd restart
10.然后再在 /home/www/ysw.erroy.cn/添加一个index.html的索引文件,内容随便写,在浏览器输入 ysw.erroy.cn 就可以访问了