logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> How-to's & Documentation & Tips View previous topic :: View next topic
Reply to topic   Topic: How-To: Advanced Site Directory Configuration
Author
shaggy



Joined: 15 Nov 2005
Posts: 82
Location: Dundee, Michigan

PostPosted: Sat 20 May '06 14:36    Post subject: How-To: Advanced Site Directory Configuration Reply with quote

Well ppl I've been thinking about some configurations to stick on my apache and haven't figured out how to do it. I have been on several site's running apache and seen these so I decided to post

1.) An up one level link -or- Parent Directory link on the top of the page?
2.) Text on bottom of version and module information?
3.) Hit counter & Hit counter to the left of Apache version information? I have mod_cntr (mod counter) but it shows nothing but zero's.
4.) How to stick other information on the top an bottom of your directory.
5.) I have seen that some ppl have "size" and "decription" (both) to the right of there files. Last modified date including time<---I think that's already there. How do I do that.
6.) Options with Decriptons.
Think that there's gonna more later on once I see them and write them down. ttyl
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sat 20 May '06 20:29    Post subject: Reply with quote

Good plan to share your knowledge.

Steffen
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Sun 21 May '06 10:22    Post subject: Reply with quote

In awnser to nr 5
http://dev.blackdot.be/manual/mod/mod_autoindex.html#adddescription

Code:

AddDescription "My Music Files" /Music


will display My Music Files in the description collom when viewing /

nr6
http://dev.blackdot.be/manual/mod/mod_autoindex.html#indexoptions

some usefull stuff in there aswel.
this is what i have
Code:

IndexOptions FancyIndexing VersionSort FoldersFirst XHTML


that puts all folder on top and makes it output valid xhtml.

in adition adding ScanHTMLTitles will scan for HTML titles and display them in the Description colom... this is disk intesive and should not be used on heavy load server IMHO

the directive IndexStyleSheet

can be used to attach a style sheet witch can be use to controle the entire look and feel of the index page
Back to top
kurono



Joined: 24 May 2006
Posts: 1

PostPosted: Wed 24 May '06 20:14    Post subject: Reply with quote

I am assuming you are using Apache 2.2.2 for this so I will post according to it.

"1.) An up one level link -or- Parent Directory link on the top of the page?"

I think by default, a Parent Directory link already exists. You're going to have to enable Fancy directory listings in order to make it stand out more with an icon. To do so, open httpd.conf and go to line 461:
Code:
# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

Uncomment the Include line and it should a bit cleaner. If you want to further edit the look, locate the httpd-autoindex.conf file (located in your Apache Folder, then follow the link above). Open it and find line 15:
Code:
#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing HTMLTable VersionSort

The parameters after IndexOptions are the values you want to change inorder to get the look you want.
More info can be found here: IndexOptions

"2.) Text on bottom of version and module information?"

Open your httpd.conf file, go to line 482:
Code:
# Various default settings
Include conf/extra/httpd-default.conf

Uncomment the Include line, as shown above and it should display the version number and related items now.

If you want to go indepth and make it show just some of the items, locate the httpd-default.conf file and go to line 55:
Code:
#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
ServerTokens Full

Just change Full to either OS, Minor, etc.
More info can be found here: ServerTokens

"4.) How to stick other information on the top an bottom of your directory."
Locate your httpd-autoindex.conf file. It should be in the same directory as the httpd-default.conf file.

Open it and go to line 85:
Code:
#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName README.html
HeaderName HEADER.html

As the commented code already says, the README.html and HEADER.html will place text at the top and bottom of an index page. Note that putting text at the bottom overwrites the ServerToken settings.

More info: HeaderName, ReadmeName
Back to top
shaggy



Joined: 15 Nov 2005
Posts: 82
Location: Dundee, Michigan

PostPosted: Thu 25 May '06 15:14    Post subject: Reply with quote

How about another one........
I was thinking about this one when I was laying down last night to go to sleep.
Let's just say you go to one of apache's main page mirror sites (pick one any one-don't matter). For the sake of this thread: http://apache.ziply.com/httpd/ <---Let's use this site. Which is one of apache's mirrored sites to d/l apache stuff. From there you'll see files to download, html files and directories/folders. Now in that folder /httpd/ (what you see there). There's gotta be more files then what you see there. Sorry but that is just a given. Let's just say there is but I only see what is there. Is there a way to restrict access to certian files viewable in directory index (see the link provided above as an example)? There's gotta be more files then what you see there. I don't wanna know if ziply.com/ apache's directory has more files then that but there's gotta be a way to show some file's and not other's. Is that .htaccess based?

There maybe more coming upon thinking and looking at other ppl's site.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 25 May '06 15:34    Post subject: Reply with quote

IndexIgnore .extension

http://httpd.apache.org/docs/2.2/de/mod/mod_autoindex.html#indexignore
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Fri 26 May '06 9:21    Post subject: Reply with quote

James Blond wrote:
IndexIgnore .extension

http://httpd.apache.org/docs/2.2/de/mod/mod_autoindex.html#indexignore


or just allowing access to the files via

Deny from all

will work aswel

<files "httpd2.2.3-dev.tar.gz">
Deny from all
</files>
Back to top


Reply to topic   Topic: How-To: Advanced Site Directory Configuration View previous topic :: View next topic
Post new topic   Forum Index -> How-to's & Documentation & Tips