虚拟主机和 window 不同端口的主机

Virtualhost and window host for different port

我 运行在我的 window 7 上安装了两个 xampp。一个是 php5.6,另一个是 php7.2php7 xampp 的端口号根据 article 更改为 7777 并且工作正常。我能够 运行 我的项目。现在的问题是我尝试为 运行 我的 laravel 网站创建虚拟主机,但该网站无法正常工作。我得到

Hmm. We’re having trouble finding that site.

这是我的虚拟主机

<VirtualHost *:7777>
    DocumentRoot "C:/xampp/htdocs/"
    ServerAdmin admin@localhost
    ServerName localhost

    <Directory "C:/xampp/htdocs/">
       Options Indexes FollowSymLinks
       AllowOverride all
       Require local
    </Directory>
</VirtualHost>

<VirtualHost *:7777>
    DocumentRoot "C:/xampp/htdocs/test_web/public/"
    ServerAdmin admin@localhost
    ServerName test.com
    ServerAlias test.com

    <Directory "C:/xampp/htdocs/test_web/public/">
      Options All
        AllowOverride All
        Order Allow,Deny
        Allow from all
       #Options Indexes FollowSymLinks

       Require local
       # if you want access from other pc's on your local network
       #Require ip 192.168.1
       # Only if you want the world to see your site
       #Require all granted
    </Directory>
</VirtualHost>

这是我的主机文件

127.0.0.1:7777  test.com
::7777      test.com

我尝试了很多组合,例如 127.0.0.1:7777::7777::1::77

主机名映射到 IP 地址,而不是端口。

主机文件不应包含端口号。

127.0.0.1:7777 应该是 127.0.0.1(IPv4 环回地址)

::7777 应该是 ::1(IPv6 环回地址)。

当您访问 non-default 端口时,应在 URL 中指定端口(即 80 用于 HTTP 或 443 用于 HTTPS)。

例如http://test.com:7777/