Solved

Apache - directory listing configuration

Posted on 2000-03-20
5
604 Views
Last Modified: 2013-12-15
Is there any way to configure how the directory listing looks?
I have a link on my intranet site that links to a directory, so users can view all the documents in it. but when the directory listing is brought up, the column for the name is not wide enough and cuts off half the documents titles. Also the text is in times new roman, but all my site is written in ariel. I just wondered if the directory listings page is configurable, if so how?
Thanks.
0
Comment
Question by:neilrodgers75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2636997
Yeah, take a look at the Apache directive IndexOptions. You can set the column widths and lots of other stuff. You can't, as far as I know, change what font the client browser is going to use unless you want to use DirectoryIndex to feed a pre-built directory listing (in html) to the client.
0
 

Author Comment

by:neilrodgers75
ID: 2639580
Sorry, could you dumb it down a little. Which file contains this info? I have found that I need to increase the line-

NameWidth=[n | *]

But I don't know which file it is in.
Thanks.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2639967
Apache is controlled by it's configuration file(s) (httpd.conf, srm.conf, access.conf) The location of this files is installation specific, so I can't necessarily tell you where they are. You can look at the init script that starts the server at bootup (probably /etc/rc.d.init.d/http) and it ought to tell you where the config dir is (quite possibly /etc/http/conf).

If you don't have it handy, the Apache docs are on-line at http://www.apache.org/docs/. You'll need to look at them for the syntax of the directives.
0
 
LVL 4

Accepted Solution

by:
kiffney earned 100 total points
ID: 2645940
You would edit httpd.conf (usually in /etc/httpd/conf, but do 'locate httpd.conf' if you don't find it there.
If you have Apache 1.3.2 or later, for the directory you want to index, you would have entries like this

<Directory /home/junkIwantlisted>
IndexOptions NameWidth=*
</Directory>

will give you a listing that is not truncated.  If you have icons in your listing, you can set the IconWidth to a certain number of pixels to give your names more room.  (Change

IndexOptions NameWidth=*

to

IndexOptions NameWidth=* IconWidth=20

and experiment.
Or you can put a number instead of a * and it will list that number of characters.  You may have to restart apache before this takes effect.

To change the font, you'd add a
Headername HEADER
inside the <directory></directory> section.  This will stick the contents of a file called HEADER.html from the directory you are listing.  You can put your font commands there.
0
 

Author Comment

by:neilrodgers75
ID: 2649056
Thats exactly what I wanted to know, I just tried it and got it working the way I want, Thanks.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question