Apache HTTPD – show full length file names in directory listings

By default, Apache HTTPD shows truncated filenames when displaying directory listings.

CentOS Linux release 7.6.1810 (Core), httpd.x86_64, 2.4.6-88.el7.centos, @base

On this version of Apache HTTPD, the solution for showing full filenames is to
nano /etc/httpd/conf.d/autoindex.conf

For a default/standard installation, somewhere near line 16, the file should contain:

IndexOptions FancyIndexing HTMLTable VersionSort

Append “NameWidth=* ” to that line, the result should be:
IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=*

and then systemctl restart httpd to pick up the new config.


As indicated above, my server is using the CentOS Base REPO package for Apache HTTPD, if you’ve installed some other package source, your config might vary.  A lot of web posts refer to a “.htaccess” file.  My server is an internal yum reposync / http package server for my internal network.  It doesn’t even contain an “.htaccess” file.  From time to time I use a browser to look thru the repo packages, but truncated filenames make that kinda useless.  So now it works.

The other options make the Name, Last Modified, and Size column headers sortable.  There’s no indication of that in browser windows, but just click on the column name and it sorts. Much easier to locate big useless font packages for addition to the yum exclude filter.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s