PDA

View Full Version : Enable Directory Listing


smakynet
4th April 2009, 18:59
I need to figure out how to enable directory listing.

Right now I get the error "Browsing this directory is forbidden"

Does anyone know how to enable Directory browsing globally?

Any help is appreciated!

till
5th April 2009, 12:28
Add the following code in the apache2.conf file:

<Directory /var/www>
Options +Indexes
</Directory>

Bikkies
8th June 2009, 16:00
If you want to configure for just a particular site/sub-directory, it can also go in the Apache Directives for required web in ISPConfig2.
Unsure about ISPConfig3

e.g.-

<Directory /var/www/web3/web/mysql-backup-reports>
Options +Indexes
</Directory>

till
8th June 2009, 16:16
Same for ispconfig 3.

edge
4th August 2009, 16:06
For some reason I can not get this to work in ISPconfig3
When looking at the .vhost file it does show the added data.

I have tested this with client ID and domain.
<Directory "/var/clients/client17/web59/web/download">
Options +Indexes
</Directory>

and <Directory /var/www/the-domain.nl/web/download>
Options +Indexes
</Directory>
Both ways give an ERROR 403 - Forbidden!
Is it only me who is having this problem? if so.. What could it be?

till
5th August 2009, 10:31
Looks correct so far. Have you took a look at the error log in the website?

edge
5th August 2009, 10:54
The error in the log file reads:client denied by server configuration: /var/www/the-domain.nl/web/download/index.php
It's correct that it can not find the index.php as it does not have one!
I want it to show the directory listing!

till
5th August 2009, 11:09
Does the site contain a .htaccess file that might apply some rewriting?

edge
7th August 2009, 15:26
I mist your reply, so sorry for the delay on your question.
And.. No... No .htaccess at all on that site!

I've only added <Directory /var/www/the-domain.nl/web/download>
Options +Indexes
</Directory> to the Apache Directives of the website in question.

Doug G
8th August 2009, 03:13
fwiw I just went through this on a test server, it seems to me I had to manually restart or reload apache to get the new directory directive to be recognized and the forbidden message to go away. I put the directive in the additional apache directives in ispconfig3. This was done on centos 5.3

edge
8th August 2009, 10:21
Thank you for your input Doug G,

I've tried this several times, but till now I still get the ERROR 403 - Forbidden!

I'm lost on this one.... I have no clue on how to fix this.

till
8th August 2009, 11:38
fwiw I just went through this on a test server, it seems to me I had to manually restart or reload apache to get the new directory directive to be recognized and the forbidden message to go away. I put the directive in the additional apache directives in ispconfig3. This was done on centos 5.3

There is no manual restart nescessary as it is done by ispconfig anyway after the configuration file has been written. You just have to wait at least one minute until the new config is written to disk. You can se this in the jobqueue in the monitor.

till
8th August 2009, 11:39
Try to add also the second path. Example:

<Directory /var/www/clients/clientX/webX/web/download>
Options +Indexes
</Directory>

DEpending on the php method you had choosen, apache might use the real path and not the symlinked path.

edge
8th August 2009, 12:09
Thank you for giving me things to try.

The "DEpending on the php method you had choosen" got me thinking!
I've disabled PHP for this client's site (it's only using html, and he did not want PHP).
Guess what.. Afer enabling PHP directory listing started to work!

So.. Now I have to find a way to get directory listing to work without enabling PHP!

till
8th August 2009, 12:34
So.. Now I have to find a way to get directory listing to work without enabling PHP!

I wrote the solution above.

edge
8th August 2009, 12:37
I wrote the solution above.

The way I read your solution is that PHP needs to be enabled!
I would like to be able to use directory listing without PHP. (PHP disabled)

till
8th August 2009, 12:38
The solution is the same even for not enabling PHP. Either the symlinked or real path will work.

edge
8th August 2009, 13:00
I must be missing something in your posts.
Whatever way I try or set the path.. As soon as I disable PHP for that client, the directory listing does not work anymore.

So. If my client wants to have directory listing he will need to live with the PHP option on :-)

till
8th August 2009, 13:02
Please post all directory directives that you have added when php is disabled and the directory listing does not work.

edge
8th August 2009, 13:56
Only working when PHP is enabled:
<Directory /var/clients/client2/web29/web/download>
Options +Indexes
</Directory>

Only working when PHP is enabled:
<Directory /var/www/domain.tld/web/download>
Options +Indexes
</Directory>

Not working at all:
<Directory /var/www/clients/client2/web29/web/download>
Options +Indexes
</Directory>

till
8th August 2009, 15:38
Thats strange indeed. I add this to the bugtracker to find out what might cause this.

bob_the_stripper
10th November 2009, 03:07
ISPConfig 3 > Website > Options > Apache directives :


<Directory "/var/www/clients/client1/web3/web/123">
Options +Indexes
</Directory>


can now list files folders in:
http://(website)/123/

(I have PHP enabled)

(using Fedora 10 perfect server, ISPConfig 3 => thanks Falko :) )

drfalken
25th November 2009, 17:47
Hello,

i can confirm the same problem, it doesn´t matter what combination of directory commands (symlink or not) i put in the conf, directory-listing (+indexes) only works if php is enabled.

regards,
falken

bhwong
30th November 2009, 08:43
I have the same problem with getting the url to list files too. No matter which conf files I enabled, it's always error 403. So where do you guys enable the PHP and which PHP did you guys enabled?

Thanks!

Boon Hong.

bhwong
30th November 2009, 08:59
I solved the listing problem. In ISPConfig3, go to System > Server Config > "Server name" > Web Tab > Security Level : High > Medium

angela
29th August 2010, 12:58
Sorry to revive an old thread but has any progress been made on this bug about Apache configuration to allow indexing of directories?

I want to use only perl; I want to allow indexing on specific directories.

And the only way to do it, as posters pointed out 9 months ago, is to enable php on a site. What progress?

amorgner
13th October 2011, 01:36
After playing around with the options and directives mentioned in this thread, I can confirm that directory listing works only if PHP is enabled.

Not good. Takes too long to figure out.