Score:0

Apache 2.4: how to show an index of files and directories?

cn flag

I'd like to configure Apache 2.4 so that where an index.html doesn't exist, the browser will display a listing of files and directories.

I have mod_dir and mod_autoindex installed and activated.

This is my config:

<VirtualHost *:80>
    
    DocumentRoot /var/www/mysite.localdev
    Servername mysite.localdev


    <Directory /var/www/mysite.localdev>
        AllowOverride none
        FallbackResource /index.php
        Require all granted
        Options +Indexes FollowSymLinks MultiViews      
    </Directory>


    ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php/mysite.sock|fcgi://127.0.0.1:9000/var/www/mysite.localdev
    DirectoryIndex index.php /index.php


    ErrorLog ${APACHE_LOG_DIR}/mysite.localdev.error-log
    

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/mysite.localdev.access-log combined

</VirtualHost>
Chris avatar
it flag
Your config seems correct, except you don't set explicit + or - in all Options, only for the first (Indexes). From what I have read in doc, it could be an issue. Try +Indexes +Follow ...
cn flag
I've prefixed '+' to all the Options parameters and restarted. No listing shows.
Bib avatar
cn flag
Bib
Load modules mod_info, then browse to /server-info/ and see what is loaded. And what do the logs say?
cn flag
@Bib loaded modules: http://pastie.org/p/7h8TInkGGbYJ1E5XfVuUl9. Regarding logs: what exactly should I be looking for in the logs?
Bib avatar
cn flag
Bib
Errors, what exactly is the problem?
cn flag
@Bib: I'm not seeing any errors related to the issue. I've described the problem in the the post here: https://serverfault.com/questions/1080066/apache-2-4-how-to-show-an-index-of-files-and-directories
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.