简体   繁体   中英

Apache showing empty “index of /”, after dist upgrade

I'm working on a Debian 7 server which I did a dist upgrade on so it is Debian 8 now.

The only thing I am having trouble with is the apache2 which got updated from 2.2 to 2.4. the problem that is that now it shows me an empty "Index of /" although there are a lot of files in the specified folders.

vHost Conf:

<VirtualHost *:80>
  ServerAdmin some@email
  ServerName some.server
  ServerAlias some.server
  DocumentRoot "/data/apt/public_html"

  <Directory "/data/apt/public_html">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Require all granted
  </Directory>

</VirtualHost>

How can I get it working again?

mixing 2.2 and 2.4 access directives is not recommended. Look at http://httpd.apache.org/docs/current/upgrading.html . You will see that they never mix Order allow,deny with Require all granted . So remove your Order line.

Mixing old and new directives

Mixing old directives like Order, Allow or Deny with new ones like Require is technically possible but discouraged. mod_access_compat was created to support configurations containing only old directives to facilitate the 2.4 upgrade. Please check the examples below to get a better idea about issues that might arise.


Also, you do not specify a DocumentIndex file so Apache does not know which file it should return a client when he asks for http://some.server/ .

Let's assume the default page is index.html, add this in your VirtualHost:

DocumentIndex index.html


Note 1: ServerAlias has the same value as ServerName , and is therefore not required.
Note 2: you should setup access and error log files for this VirtualHost. It might not be useful if you have only 1 VirtualHost, but you will thank me if you have a large site (with multiple VH later).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM