No icons in Apache directory listings under Sierra

Discussion in 'Mac OS X Server, Xserve, and Networking' started by bedouin, Oct 11, 2018.

  1. bedouin macrumors member

    Joined:
    Mar 3, 2011
    #1
    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?
     
  2. HenryAZ macrumors 6502a

    HenryAZ

    Joined:
    Jan 9, 2010
    Location:
    South Congress AZ
    #2
    Are the icons present? /usr/share/httpd/icons/
     
  3. bedouin thread starter macrumors member

    Joined:
    Mar 3, 2011
  4. bedouin thread starter macrumors member

    Joined:
    Mar 3, 2011
    #4
    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.
     
  5. HenryAZ macrumors 6502a

    HenryAZ

    Joined:
    Jan 9, 2010
    Location:
    South Congress AZ
    #5
    Do you have the autoindex_module loaded in httpd.conf ?
    --- Post Merged, Oct 12, 2018 ---
    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]">
     
  6. bedouin thread starter macrumors member

    Joined:
    Mar 3, 2011
    #6
    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.

    [​IMG]
     
  7. HenryAZ macrumors 6502a

    HenryAZ

    Joined:
    Jan 9, 2010
    Location:
    South Congress AZ
    #7
    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/
     

Share This Page

6 October 11, 2018