本週知道了主機名一樣能夠用域名,因而便想試着分配些子域名。直接能夠在雲解析分配子域名啓用,再在服務器設置vhost文件,添加子域名指向目錄重啓apache便可。web
騰訊雲=>雲解析=>一級域名=>點擊域名添加記錄=>主機記錄(子域名)、記錄值(ip地址)。須要將虛擬主機的註釋刪去!!!apache
例如chenyu.mydearest.cn服務器
<VirtualHost *:80>ide
ServerAdmin help@websoft9.comrest
DocumentRoot "C:/websoft9/wampstack-7.0.7-0/apache2/htdocs/myself/"ip
ServerName chenyu.mydearest.cn域名
ServerAlias chenyu.mydearest.cnio
ErrorLog "logs/demo.websoft9.cn-error.log"騰訊
CustomLog "logs/demo.websoft9.cn-access.log" commonerror
<Directory "C:/websoft9/wampstack-7.0.7-0/apache2/htdocs/" >
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>