解决方案一:通过端口来区分,缺点:不是80端口域名后要加端口www.zhandian2.com:81
解决方案二:通过ServerName来区分
<virtualHost *:80>
DocumentRoot "d:/myblog"
#配置第一个站点
ServerName www.bkk1.com
DirectoryIndex news.html index.html
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<virtualHost *:80>
DocumentRoot "d:/myblog2"
#配置第二个站点
ServerName www.bkk2.com
DirectoryIndex news.html index.html
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
时间: 2024-10-09 21:41:42