【发布时间】:2015-05-19 02:11:08
【问题描述】:
我在 WampServer 上同时托管两个网站时遇到了困难。这是我已经完成的:
我的网站源文件分别是 C:\wamp\www\familyhistorywebsitetemplate 和 C:\wamp\www\cutillowebdesign
- 我通过将以下内容添加到文件末尾来编辑主机文件(不在同一行且没有分号:)
127.0.0.1 cutillohistory.tk; 127.0.0.1 familyhistorywebsites.tk
2:我在 httpd.conf 文件中取消注释“包含 conf/extra/httpd-vhosts.conf”以在 Apache 中启用我的虚拟主机
3:我在 WAMP 中设置了虚拟主机(C:\wamp\bin\apache\Apache2.4.4\conf\extra\httpd-vhosts.conf)——它是这样的:
<VirtualHost *:80>
ServerAdmin localhost.admin
Document Root "C:\wamp\www"
ServerName localhost
<VirtualHost *:80>
ServerAdmin admin@cutillohistory.tk
DocumentRoot "C:\wamp\www\cutillowebdesign"
ServerName cutillohistory.tk
ServerAlias www.cutillohistory.tk
<Directory "C:\wamp\www\cutillowebdesign">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/cutillohistory.tk-error.log"
CustomLog "logs/cutillohistory.tk-access.log" common
<VirtualHost *:80>
ServerAdmin admin@familyhistorywebsites.tk
DocumentRoot "C:\Websites\familyhistorywebsitetemplate"
DirectoryIndex index.cfm index.php
ServerName familyhistorywebsites.tk
ServerAlias www.familyhistorywebsites.tk
<Directory "C:\Websites\familyhistorywebsitetemplate">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/familyhistorywebsites.tk-error.log"
CustomLog "logs/familyhistorywebsites.tk-access.log" common
非常感谢您能给我的任何帮助!
【问题讨论】: