Celeb Glow
news | April 03, 2026

Apache Newbie Confused - Can't make directory listing work

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
ServerName site1.com
ServerAlias
DocumentRoot /var/www/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory "/var/www/ AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/apache2/.htpasswd Require valid-user Options Indexes Index Options FoldersFirst IgnoreCase </Directory> </VirtualHost>

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/ and see no files listed.

Since the DocumentRoot is set to /var/www/ 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, Victor

1 Answer

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

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy