Blogs about Deep Learning, Machine Learning, AI, NLP, Security, Oracle Traffic Director,Oracle iPlanet WebServer

  • February 25, 2007

Directory listing in Sun Java System Web Server 7.0

Directory listing in Sun Java System Web Server 7.0

Been getting a lot of questions about directory listing in Sun Java System
Web Server 7.0

I have setup a Sun Java System Web Sever 7.0. I am not able see directory contents. I get a popup saying "Authentication Required". Under "Content Handling"->"General"->"Directory Listing", I tried setting "Listing Type" to 'Fancy' & 'Simple'.  But that did not help (I saved and re-deployed the server instance).

Here is the solution. Check in obj.conf configuration file if "index-common" service SAF is present:

Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"

Directory listing is not enabled by default. If you look at the default ACL file default.acl, (assuming you do not have any other other VS specific ACL file)

version 3.0;

acl "default";

authenticate (user, group) {

  prompt = "Sun Java System Web Server";


allow (read, execute, info) user = "anyone";

allow (list, write, delete) user = "all";

That shows "list" right is allowed to
"all" (authenticated users only). And for directory listing, you need "list" rights. That means only authenticated users can see directory lists.

You can move this "list" right to "anyone" so that even
unauthenticated users can see the directory lists.

So here is what the changed ACEs should look like :

allow (read, execute, info, list) user = "anyone";

allow (write, delete) user = "all";

Two more minor tips I would like to add

1. If you want to change the width of the columns of filename, last modified time, size, description in directory listing, add "cindex-init" directive in magnus.conf. For example

Init fn="cindex-init" widths="50,5,5,20"

2. If you want to change the directory listing to "simple" style where you will only see the list of filenames, you can change "index-common" to "index-simple" as shown below

Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-simple"

Join the discussion

Comments ( 1 )
  • Abhay Dabholkar Saturday, April 5, 2008

    Nice info. I dont want user to see directory listing, at the same time i do not wish to pop-up authentication box. I just want to say "Not Authorized" How to do this?

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.