Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bedouin

macrumors member
Original poster
Mar 3, 2011
95
7
I have fancyindexing enabled in Apache on my machine running Sierra, but the icons are not appearing in directory listings. The error logs don’t seem to indicate that the client is even trying to retrieve them. How can I get the icons to appear?
 

bedouin

macrumors member
Original poster
Mar 3, 2011
95
7
Actually, if you view the HTML from the listing, the server isn't even linking to the images. All other elements of the "fancyindex" are there.
 

HenryAZ

macrumors 6502a
Jan 9, 2010
690
143
South Congress AZ
Do you have the autoindex_module loaded in httpd.conf ?
[doublepost=1539346087][/doublepost]Here's my directory config for the root directory:
<Directory /Users/henry/www/local-root>
Options Indexes FollowSymLinks MultiViews
IndexOptions NameWidth=* FancyIndexing FoldersFirst IgnoreCase
AllowOverride None
Require all granted
</Directory>

Results in this:

Index.jpg


And the icons are referenced as so:
<img src="/icons/folder.gif" alt="[DIR]">
 

bedouin

macrumors member
Original poster
Mar 3, 2011
95
7
Yes, I do:

LoadModule autoindex_module libexec/apache2/mod_autoindex.so

Here's what I have in the .htaccess file for the directory being shared:

IndexOptions FancyIndexing

But this is the output.

IkuEZm3.jpg
 

HenryAZ

macrumors 6502a
Jan 9, 2010
690
143
South Congress AZ
Yes, I do:

LoadModule autoindex_module libexec/apache2/mod_autoindex.so

Here's what I have in the .htaccess file for the directory being shared:

IndexOptions FancyIndexing
Rather than using .htaccess, have you considered/tried configuring the directory in httpd.conf? I have had to fight/research with .htaccess directives to get them right, and there might be something else you need to include in .htaccess to make it work. I only use them when absolutely necessary, such as when the server is hosted by an ISP and I don't have direct access to httpd.conf. Here is a partial snippet of my .htaccess file from an ISP hosted server:
Code:
<Files *>
    Options +Indexes
    IndexOptions FancyIndexing NameWidth=48 SuppressDescription SuppressLastModified
    AddIcon (IMG,/icons/image2.gif) .gif .jpg .png
    AddIcon (TXT,/icons/text.gif) .htm .html .txt
    AddIcon (PDF,/icons/pdf.gif) .pdf
</Files>

The Apache Project has excellent and extensive documentation:
https://httpd.apache.org/docs/2.4/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.