【问题标题】:Multiple vhosts with XAMPP 3.2.1使用 XAMPP 3.2.1 的多个虚拟主机
【发布时间】:2015-09-22 06:09:52
【问题描述】:

我无法识别第二个 VirtalHost。几年前我让它工作,但在升级路径的某个地方它坏了。

localhost 被识别。 dev 不是。我在 Windows 7 上使用 XAMPP v3.2.1。在浏览器中输入 dev 会将我发送到浏览器的搜索引擎。 httpd-vhosts.conf 和 hosts 文件设置如下,我已经包含了来自 C:\xampp\apache\bin\httpd -S 的转储。任何帮助将不胜感激。

注意:如果我在dev 目录中输入index.php 文件的显式路径,它不会作为php 文件运行,但只会列出内容。

另外:在我的 access.log 中,我得到以下信息:

127.0.0.1 - - [04/Jul/2015:09:48:12 -0700] "GET /css/ms.js HTTP/1.1" 304 - "http://localhost/dev" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"

我的 C:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot "D:/Website/root"
    ServerName localhost

    <Directory "D:/Website/root">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order deny,allow
        deny from all
        Allow from localhost
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "D:/Website/dev"
    ServerName dev

    <Directory "D:/Website/dev">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order deny,allow
        deny from all
        Allow from localhost
        Require all granted
    </Directory>
</VirtualHost>

我的 c:\windows\system32\drivers\etc

# localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost
    127.0.0.1       dev

C:>C:\xampp\apache\bin\httpd -S

VirtualHost configuration: *:80                is a NameVirtualHost
         default server localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:44) 
         port 80 namevhost localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:44)
         port 80 namevhost dev (C:/xampp/apache/conf/extra/httpd-vhosts.conf:60)
ServerRoot: "C:/xampp/apache"
Main DocumentRoot: "D:/Website/root"
Main ErrorLog: "C:/xampp/apache/logs/error.log"
Mutex rewrite-map: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="C:/xampp/apache/logs/" mechanism=default
PidFile: "C:/xampp/apache/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG

【问题讨论】:

    标签: apache xampp vhosts


    【解决方案1】:

    让它工作。

    配置正确

    .htaccess 文件中的 include_path 不正确。

    Firefox 将我重定向到我的搜索引擎,但给了我一个提示,上面有一个类似这样的提示:“你想改为去开发吗?”当我点击它时,它给了我一个错误,我可以追溯到路径是问题。

    IE 刚刚重定向到我的搜索引擎。

    浏览器越来越smart 试图通过将我发送到搜索来解析我的条目。

    【讨论】:

      猜你喜欢
      • 2016-07-19
      • 2015-09-24
      • 2021-02-10
      • 2015-04-29
      • 2016-02-15
      • 2019-06-11
      • 2011-04-26
      • 2012-08-27
      • 2017-01-26
      相关资源
      最近更新 更多