Stop Microsoft

Miscellaneous => Programming & Networking => Topic started by: TheQuirk on 28 December 2002, 21:49

Title: Apache autoindexer
Post by: TheQuirk on 28 December 2002, 21:49
I was starting to think about downloading some script that'll show the contents of a folder and link to the files (or writing, if there were no available). I then realized that this was dumb because apache had "autoindexer" builtin - my question is, how would I utilize it? I know Void has done it...
Title: Apache autoindexer
Post by: Kintaro on 28 December 2002, 18:42
i was going to ask this to, as a lan party is coming up and i want to share things.
Title: Apache autoindexer
Post by: beltorak0 on 29 December 2002, 04:31
<Directory "<<whatever>>">
  Options Indexes << or FancyIndexes >>
  Order allow,deny
  Allow from all
</Directory>

Check your httpd.conf; also see Apache Online Docs (http://httpd.apache.org/docs-project/)

-t.
Title: Apache autoindexer
Post by: Master of Reality on 29 December 2002, 05:05
or if you want it in all directories than put Options Indexes in the root container.
The default apache usually has this enabled i believe, and i also think that default is that indexes act as fancy indexes anyway.
Title: Apache autoindexer
Post by: TheQuirk on 29 December 2002, 12:59
NO NO, I'm looking for the directive called "headers" or something like that...
Title: Apache autoindexer
Post by: Master of Reality on 29 December 2002, 22:51
huh?
Title: Apache autoindexer
Post by: beltorak0 on 30 December 2002, 23:38
You mean the header that is displayed whenever you view a directory?  It's a file, notmally HEADER that is in the directory.

from that apache link I gave you:
Apache Docs (1.3) (http://httpd.apache.org/docs/mod/mod_autoindex.html#headername)
 
quote:

HeaderName  directive
Syntax: HeaderName filename
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex
Compatibility: some features only available after 1.3.6; see text

The HeaderName directive sets the name of the file that will be inserted at the top of the index listing. Filename is the name of the file to include.

    Apache 1.3.6 and earlier: The module first attempts to include filename.html as an HTML document, otherwise it will try to include filename as plain text. Filename is treated as a filesystem path relative to the directory being indexed. In no case is SSI processing done. Example:

        HeaderName HEADER

    when indexing the directory /web, the server will first look for the HTML file /web/HEADER.html and include it if found, otherwise it will include the plain text file /web/HEADER, if it exists.




read som other stuff there (like IndexIgnore, ReadmeName, etc etc).

-t.
Title: Apache autoindexer
Post by: Kintaro on 4 January 2003, 16:55
cool
Title: Apache autoindexer
Post by: voidmain on 4 January 2003, 19:50
I use "HEADER.html" and "README.html" to modify the beginning and end of the HTML generated by mod_autoindex. If you want an example see http://voidmain.kicks-ass.net/files/HEADER.html (http://voidmain.kicks-ass.net/files/HEADER.html) and http://voidmain.kicks-ass.net/files/README.html (http://voidmain.kicks-ass.net/files/README.html) so when you view http://voidmain.kicks-ass.net/files/ (http://voidmain.kicks-ass.net/files/) it shows up the way I want it.

You can also manipulate the columns using key words in your httpd.conf:

IndexOptions FancyIndexing HTMLTable SuppressHTMLPreamble VersionSort NameWidth=* DescriptionWidth=* SuppressLastModified

You might want to look at the documentation for mod_autoindex at www.apache.org. (http://www.apache.org.)

I also slightly changed the source code for mod_autoindex. It was spitting out HTML that I believe was wrong so I fixed it to pass HTML 4.01.

[ January 04, 2003: Message edited by: void main ]

Title: Apache autoindexer
Post by: Kintaro on 9 January 2003, 19:27
Thanks VoidMain.

You have a PM that i sent a while ago btw.
Title: Apache autoindexer
Post by: Kintaro on 9 January 2003, 21:03
My system complained about FancyIndexes, said it was illegal, and that the penguin police where going to arrest me.

Well actually it said it was invalid, and im using the default apache with Red-Hat.

However i did add the directive from webmin, because im a lazy slag.

Im also going to lan party in 2 days, does anyone know some good firewall software for Linux that isnt IP Chains?
Title: Apache autoindexer
Post by: voidmain on 9 January 2003, 23:50
quote:
Originally posted by l33t h4x0r dud3:
My system complained about FancyIndexes, said it was illegal, and that the penguin police where going to arrest me.

Well actually it said it was invalid, and im using the default apache with Red-Hat.

However i did add the directive from webmin, because im a lazy slag.



Maybe because the directive is "FancyIndexing" and not "FancyIndexes". I copy/pasted it right from my Apache config on my Red Hat box. I never use Webmin for Apache configuration. Actually about the only thing I use it for is MySQL/PostgreSQL database/user creation and setting database permissions but I don't always use it for that either.

 
quote:

Im also going to lan party in 2 days, does anyone know some good firewall software for Linux that isnt IP Chains?



iptables
Title: Apache autoindexer
Post by: voidmain on 9 January 2003, 23:55
quote:
Originally posted by l33t h4x0r dud3:
You have a PM that i sent a while ago btw.


Uh, not me. Are you sure you didn't send it to someone else?