【问题标题】:Why aren't my virtual hosts on WampServer working?为什么我的 WampServer 上的虚拟主机不工作?
【发布时间】:2015-05-19 02:11:08
【问题描述】:

我在 WampServer 上同时托管两个网站时遇到了困难。这是我已经完成的:

我的网站源文件分别是 C:\wamp\www\familyhistorywebsitetemplate 和 C:\wamp\www\cutillowebdesign

  1. 我通过将以下内容添加到文件末尾来编辑主机文件(不在同一行且没有分号:)

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

非常感谢您能给我的任何帮助!

【问题讨论】:

    标签: apache virtual hosts


    【解决方案1】:

    我没有看到任何一个 VirtualHost 结束标记 (&lt;/VirtualHost&gt;)。复制/粘贴错误,还是您忘记了?

    【讨论】:

    • 抱歉,我刚刚注意到 - 这只是一个复制和粘贴错误,我确实有 VirtualHost 结束标签
    猜你喜欢
    • 2015-03-05
    • 2012-01-22
    • 2011-11-21
    • 2015-08-15
    • 2020-12-01
    • 2014-07-04
    • 2013-04-10
    相关资源
    最近更新 更多