Apache2 从 13.10 更新至 14.04

Apache2 从 13.10 更新至 14.04

我使用的网络服务器 (PHP) 在 13.10 之前运行良好。现在我更新到了 14.04 TLS

Apache2 服务器(我的印象)不在正确的目录 \var\www 中

这是我所看到的:

Index of /

[ICO]   Name    Last modified   Size    Description
Apache/2.4.7 (Ubuntu) Server at luke2 Port 80

当我使用http://luke2.avmbenelux.local/info.php我懂了:

Not Found

The requested URL /info.php was not found on this server.

Apache/2.4.7 (Ubuntu) Server at luke2 Port 80

当我查看 /var/www 时,我看到 info.php 可用

Apache2.conf:

# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

任何想法?

答案1

我遇到了类似的问题。我查看了 000-default 虚拟主机。它的 DocumentRoot 是 /var/www/html,而不是 /var/www。一旦我更改了它并重新启动了 Apache,一切就都恢复正常了。

相关内容