为什么WampServer上的虚拟主机无法工作?

时间:2015-03-16 19:49:35

标签: apache virtual hosts

我在WampServer上同时托管两个网站时遇到了困难。这就是我已经做过的事情:

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

  1. 我编辑了主机文件,将下面的内容添加到文件的末尾(不在同一行,没有分号:)
  2. 127.0.0.1 cutillohistory.tk; 127.0.0.1 familyhistorywebsites.tk

    2:我取消注释"包括conf / extra / httpd-vhosts.conf"在httpd.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
    

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

1 个答案:

答案 0 :(得分:0)

我没有看到任何VirtualHost结束标记(</VirtualHost>)。复制/粘贴错误,还是忘了它们?