【问题标题】:Apache 2.4 redirecting local virtual host to https instead httpApache 2.4 将本地虚拟主机重定向到 https 而不是 http
【发布时间】:2018-10-12 06:37:25
【问题描述】:

我正在使用 MAC 操作系统和 apache 2.4。我为本地开发创建了一个虚拟主机。这个虚拟主机正在重定向到 https 而不是简单的 http(我需要它在 http 中工作)。我已经在 chrome 和 safari 上试过了。这是一个laravel项目。

这里是httpd-vhosts.conf的内容

#    ServerAlias www.dummy-host.example.com
#    ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
#    CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
#</VirtualHost>

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host2.example.com
#    DocumentRoot "/usr/docs/dummy-host2.example.com"
#    ServerName dummy-host2.example.com
#    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
#    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
#</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Library/WebServer/Documents/onboardera/public"
    ServerName onboardera.dev
    ServerAlias onboardera.dev
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Library/WebServer/Documents/multi-site/public"
    ServerName multi-site.dev
    ServerAlias multi-site.dev
</VirtualHost>

以下是hosts文件的内容。

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
127.0.0.1       multi-site.dev
127.0.0.1       khan.multi-site.dev
127.0.0.1       onboardera.dev
255.255.255.255 broadcasthost
::1             localhost

Screenshot is also attached

【问题讨论】:

标签: linux laravel macos apache virtualhost


【解决方案1】:

.dev 域属于 google,Google Chrome 已推出 v63,现在强制所有 .dev 域使用 HTTPS。

因此,您可以尝试其他浏览器或使用.local.test

可行的选择是切换到 Firefox 作为您的开发浏览器。它速度快,拥有舒适的开发工具,并且在过去几年中确实取得了大量改进。

【讨论】:

    【解决方案2】:

    尝试用户设置 .test 并在没有 www 的情况下调用它,例如 onboardera.test 我遇到了这个问题,做了上面提到的改变,它对我有用

    【讨论】:

      猜你喜欢
      • 2016-07-16
      • 2014-04-11
      • 2012-03-29
      • 2017-04-08
      • 2019-08-13
      • 2018-06-03
      • 1970-01-01
      • 1970-01-01
      • 2018-07-08
      相关资源
      最近更新 更多