Solved

Apache - directory listing configuration

Posted on 2000-03-20
5
605 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

617 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