Q. I’m using Apache 2 under Linux. How do I enable apache file and directory indexing? Currently it is disabled and I would like to enable the same for /pdfs/ directory (http://domain.com/pdfs).
A. Under Apache web server automatic index generation is enabled with using Options +Indexes or Options Indexes directive.
If a URL which maps to a directory is requested, and there is no DirectoryIndex (e.g., index.html) in that directory, then mod_autoindex will return a formatted listing of the directory.
Option # 1: Using Apache config file
Add directory option to Apache configuration file /etc/httpd/httpd.conf or /etc/apache2/apache2.conf:
# vi /etc/apache2/apache2.conf
Add following code:
<Directory /var/www/domain.com/pdfs>
Options Indexes FollowSymLinks
</Directory>
Save and close the file. Restart Apache:
# /etc/init.d/httpd restart
OR
# /etc/init.d/apache2 restart
Option #2: Using .htaccess Files with Apache
You can place config line Options Indexes in .htaccess file. Make sure .htaccess file support is enabled.
Change directory to pdfs
$ cd pdfs
Open .htaccess file
$ vi .htaccess
Append following apache directive:
Options Indexes
Save and close the file.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop










![Apache: [warn] _default_ VirtualHost overlap on port 80, the first has precedence Error and Solution](http://s13.cyberciti.org/images/shared/rp/3/27.jpg)

{ 4 comments… read them below or add one }
Make sure .htaccess file support is enabled.
How to check if thats there in apache Distros.
What is the aim of “Using .htaccess Files with Apache”?
I did so but i still have the Forbidden Error message I can read the files but i can’t list them
I have the same problème
can you help me?
i tried with options indexes// options -indexes//options +indexes//
i have dedecated server
This is wrong for
It should be :