Solved

Apache - directory listing configuration

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mobaxterm not able to change directory 28 109
AWS CLI issues with Tags 3 66
nagios 1 22
issue in getting eth0 IP in oracale virtual box Linux VM 4 42
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

867 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

22 Experts available now in Live!

Get 1:1 Help Now