【问题标题】:VirtualBox Ubuntu 16.04 apache2 vhost jumping to https or not showing the pageVirtualBox Ubuntu 16.04 apache2 vhost 跳转到 https 或不显示页面
【发布时间】:2018-08-29 06:50:29
【问题描述】:

我正在尝试在带有 Ubuntu 16.04 Apache2 PHP 7.0 的 Virtual Box 上设置一些虚拟主机,以开始将代码移至 PHP7。

我已经从看起来像这样的旧 VBox 中移动了 v-host 文件

<VirtualHost 192.168.2.174:80>
    ServerName admin.ubuntu16.de
    ServerAlias admin.ubuntu16.de
    ServerAdmin email@company.de
    DocumentRoot /home/www/public_html/workspace/admin

    php_value auto_prepend_file '/home/www/public_html/workspace/admin/administration/conf/register_globals.php'

    <Directory /home/www/public_html/workspace/admin>
        Options Indexes FollowSymLinks MultiViews ExecCGI
        Options All
        AllowOverride  All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

但它一直尝试使用 https 加载页面或说无法访问站点根文件夹

这些设置在带有 apache2 和 PHP 5.5.something 的 Ubuntu 14 Virtuall Box 上完美运行

所以我按照教程把它改成了简单的

<VirtualHost 192.168.2.174:80>
    ServerName admin.ubuntu16.de
    ServerAlias admin.ubuntu16.de
    ServerAdmin email@company.de
    DocumentRoot /home/www/public_html/workspace/admin
</VirtualHost>

但现在它只是直接跳转到https模式

我显然跑了 a2ensite 我还通过运行“a2dissite 000-default.conf”关闭了默认站点

我还启用了模块来处理代理和其他一些问题,同时让 appache 真正启动 :-)

非常感谢我可能错过的任何想法。

稍微修改一下: 站点的所有文件都位于主 Windows 机器上,并通过 /media/sf-workspace 导入 然后将符号链接创建为 /home/www/public_html/workspace

【问题讨论】:

    标签: apache virtualbox ubuntu-16.04 php-7


    【解决方案1】:

    我会首先消除符号链接,然后复制虚拟框内的所有文件以删除该变量。

    Apache 的符号链接可能很麻烦。

    【讨论】:

    • 我尝试将 php 文件复制到 /home/www/public_html/ 文件夹中。但是当我尝试刷新浏览器时,它仍然将我发送到 'h.t.t.p.s://admin.ubuntu16.de' 我被发送到 https 感到困惑,因为它尚未设置。
    猜你喜欢
    • 2020-11-18
    • 1970-01-01
    • 1970-01-01
    • 2018-07-30
    • 2016-01-03
    • 2018-09-26
    • 1970-01-01
    • 2017-08-23
    • 1970-01-01
    相关资源
    最近更新 更多