Solved

Apache - directory listing configuration

Posted on 2000-03-20
5
568 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
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thats exactly what I wanted to know, I just tried it and got it working the way I want, Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now