Apache2 [SOLVED]: Apache Newbie Confused – Can't make directory listing work

Apache2 [SOLVED]: Apache Newbie Confused – Can't make directory listing work

Home Forums Apache2 Apache2 [SOLVED]: Apache Newbie Confused – Can't make directory listing work

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #36899



    Hopefully some of you can help me out.

    I’m a beginner when it comes to Apache and am trying to teach myself its core elements by going through the groundwork to set up a server with DirectoryListing and Password Authentication in my VMware on ubuntu.

    What I want to accomplish:
    Be able to connect to “site1.com” and see a directory listing such as:

    My issue is the following:

    I have the following code in my config file within /etc/apache2/sites-available/site1.com.conf (forgive the formatting, first post on here in years):

    <VirtualHost *:80>
    ServerAdmin serveradmin@admin.com
    ServerName site1.com
    ServerAlias www.site1.com
    DocumentRoot /var/www/site1.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
     <Directory "/var/www/site1.com/public_html>
     AuthType Basic
     AuthName "Restricted Content"
     AuthUserFile /etc/apache2/.htpasswd
     Require valid-user
     Options Indexes
     Index Options FoldersFirst IgnoreCase

    The password authentication works just fine, but I’m not sure where I’m supposed to put files to see if the Directory Listing works or if the Directory Listing simply doesn’t work. When I connect to site1.com on my virtual machine, I simply see the contents of index.html within /var/www/site1.com/public_html/index.html and see no files listed.

    Since the DocumentRoot is set to /var/www/site1.com/public_html, I assume this is where I place files. I’ve created a file called Test4.html and a folder called FolderTest within this directory for testing purposes, but as I wrote above, I’m not sure if these are in the right format or if they’re even in the right place.

    I’ve tried affixing a “+” before Indexes, so that it reads Options +Indexes but that didn’t work either.

    Any and all help would really be appreciated as I feel completely stuck and am unsure of where to go from here.

    Kind regards,



    Accepted AnswerAnswer

    Remove index.html. The directory index is displayed only if an index file does not exist.

    Source: https://askubuntu.com/questions/990430/apache-newbie-confused-cant-make-directory-listing-work
    Author: fkraiem
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.