Sample Header Ad - 728x90

How to generate index.html for each directory under /var/www/html

0 votes
1 answer
549 views
I have downloaded confluent software for upgrade under /var/www/html directory. I need to create an index.html for directory listing for each directory. I tried adding below to .htaccess file in the directory (I saw it somewhere, where the index.html existed with files in the directory), but it did not work:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
Is there a utility or tool that will allow me to do that? Someone asked me to create it manually, but I don't really want to create it manually. **UPDATE** @Ipor Sircer / @Marcus Müller I updated the httpd.conf file - now it is like below:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Relax access to content within /var/www.
#

    AllowOverride None
    # Allow open access:
    Require all granted


# Further relax access to the default document root:

    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options 
    # for more information.
    #
    Options +Indexes +FollowSymLinks
    IndexOptions +FancyIndexing +HTMLTable

    #Options None

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    #AllowOverride None
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
This is under /var/www/html:
pwd
/var/www/html

drwxr-xr-x 5 root root  86 Nov  7 18:10 .
drwxr-xr-x 4 root root  33 Aug 12 15:33 ..
drwxr-xr-x 4 root root  46 Nov  6 13:35 clients
drwxr-xr-x 3 root root  55 Nov  6 19:52 packages.confluent.io
drwxr-xr-x 3 root root  17 Nov  6 15:57 rpm
But when I go to the server, I get the below: ![http://server](https://i.sstatic.net/m4Z4a.png) Whereas if I go to server/rpm, I get this: ![http://server/rpm](https://i.sstatic.net/K9c6t.png) What else do I need to change, so I can see the directory under /var/www/html from the browser?
Asked by adbdkb (103 rep)
Nov 7, 2023, 08:50 PM
Last activity: Nov 9, 2023, 04:05 PM