We use the directory index listing feature to display the directory of our document archive on an Apache Web server. Long file names are getting chopped off by Apache in the generated Web pages. Can we configure the server to show the entire file names in directory index listing pages?
Yes - Apache versions 1.3.2 and later can use configuration directives provided by the mod_autoindex module to customize the appearance of automatically generated directory index listings. To do this, use the NameWidth option available as part of the IndexOptions directive.
This directive can be used in the main server configuration file, a virtual host or directory configuration section, or in a directory-level htaccess file. Place a line in your configuration that looks like "IndexOptions NameWidth=*". The asterisk is a wild card that tells Apache to give as much space to the file name column as needed to show the longest file name in the list.
You can set a specific width by replacing the asterisk with the number of characters you want to use for the column. Other options include FancyIndexing to show file and folder icons, and FoldersFirst to tell Apache to list folders above file names in directory listings.
| Use this form to start a public discussion with other Linux World users on this article. Log In | Register for an account (Why you should) |
Note: Register to have your user name appear; otherwise your comment will show up as "Anonymous."
*Anonymous comments will only appear once they are approved by the moderator.
• Dell puts Linux and Atom in Vostro PCs
• Mozilla names best Firefox 3 add-ons
• Torvalds: Fed up with the 'security circus'
• Dell Latitude ON - big win for Linux
• Open source advocates hail appeals court ruling
LinuxWorld Conference and Expo San Francisco, August 4-7, 2008.
Linux Plumbers Conference Portland, OR, Sept. 16-19, 2008.
FreedomHEC Santa Monica, November 8-9, 2008.
| The Trend from UNIX to Linux in SAP(r) Data Centers |