The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Directory Listing. mod_autoindex

Discussion in 'General Discussion' started by DigiCrime, May 11, 2011.

  1. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    I was briefly reading about this how does this work on Cpanel? I would like to generate some decent directory listings with icons so it loooks a little more organized.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    This would work on cPanel similar to how it works on any Apache machine, since this is a default Apache module. The details for it are at the following site for Apache 2.2:

    mod_autoindex - Apache HTTP Server

    Basically, mod_autoindex is called if mod_dir isn't being used by the domain for DirectoryIndex content instead.

    What is the specific question you have about mod_autoindex?
     
  3. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    Nothing specific to mod_autoindex I was googling on this and that is what came up. But the dates on them are really old and I found nothing on Cpanel except how to disable directory listing, which is the opposite of what I want to do. That I know how :)

    I tried to search for a image but couldn't find anything with clarity. What I hve right now on my server -- you can't tell the difference from a folder or a file its blan, flat looking.
     
  4. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    And I want to change that blan look to something cleaner.. thats what my question is. How would I do this within Cpanel or do I need to build autoindex separately
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What do you have in your .htaccess file for the account in question? Usually FancyIndexing can handle showing the icons, and you can add icons using AddIcon syntax into Apache (although you'd want to use one of the includes in /usr/local/apache/conf/includes/ rather than directly writing into httpd.conf itself). The documentation for AddIcon is the following:

    mod_autoindex - Apache HTTP Server

    Also, the icons directory that handles the icons is at /usr/local/apache/icons on a cPanel machine.
     
  6. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    AuthType Basic
    AuthName "nothing"
    AuthUserFile "xxxxxxxxxxx
    require valid-user


    Thats all that is in there its pass protected directory

    The includes directory has

    -rw-r--r-- 1 root root 1668 Jun 7 2010 errordocument.conf
    -rw------- 1 root root 0 Jun 7 2010 post_virtualhost_1.conf
    -rw------- 1 root root 0 Jun 7 2010 post_virtualhost_2.conf
    -rw------- 1 root root 0 Jun 7 2010 post_virtualhost_global.conf
    -rw------- 1 root root 0 Jun 7 2010 pre_main_1.conf
    -rw------- 1 root root 0 Jun 7 2010 pre_main_2.conf
    -rw------- 1 root root 0 Jun 7 2010 pre_main_global.conf
    -rw------- 1 root root 0 Jun 7 2010 pre_virtualhost_1.conf
    -rw------- 1 root root 0 Jun 7 2010 pre_virtualhost_2.conf
    -rw------- 1 root root 0 Jun 7 2010 pre_virtualhost_global.conf

    Empty files. I didnt find anything on "icons" in the httpd.conf file so I have to add it?
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The icons will automatically be used from the icons directory. You need to add FancyIndexing in cPanel > Index Manager area first for the account. At that point, if you want to add any icon types that do not already exist, you would add an include such as into the "pre_main_global.conf" file and use:

    Code:
    AddIcon (IMG,/icons/imagename.png) .extensionname
    Where imagename.png is the name of the image, and .extensionname is the name of the extension that should show that image. Let's say you want .php pages to show a set icon type, then replace .extensionname with .php instead.

    You'd then need to place the image into /usr/local/apache/icons directory.

    After doing all of that, then make a backup of Apache, distill your includes into Apache, rebuild Apache and restart Apache for the changes to take effect using these steps:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110511
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
     
Loading...

Share This Page