Apache2; mod_autoindex, HeaderName & DocumentRoot.

This is a discussion on Apache2; mod_autoindex, HeaderName & DocumentRoot. within the Linux Web Servers forums, part of the Web Server and Related Forums category; I'm having a problem or two with Apache 2 & the header I wish to include for my auto-...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-19-2003
Stroller
 
Posts: n/a
Default Apache2; mod_autoindex, HeaderName & DocumentRoot.

I'm having a problem or two with Apache 2 & the header I wish to
include for my auto-indexed directories. I can't seem to work it out,
and am hoping someone can help me.

I have a number of virtual hosts, and I want each one of them to
include the same header for their directory index - for instance if I
wanted both user1.stroller.uk.eu.org & user2.stroller.uk.eu.org to
have a link to a banner ad at the top of all of their pages, including
user1.stroller.uk.eu.org/foo/ & user2.stroller.uk.eu.org/bar/

So in /etc/apache2/conf/commonapache2.conf I have sections that look
something like this:

<IfModule mod_alias.c>
Alias /icons/ /home/httpd/icons/
Alias /markup/ /home/httpd/markup/
Alias /doc /usr/share/doc

</IfModule>
# End of Alias directives.

<IfModule mod_autoindex.c>
# FancyIndexing is whether you want fancy directory indexing or
standard
IndexOptions FancyIndexing VersionSort NameWidth=*
SuppressHTMLPreamble

# AddIcon* directives tell the server which icon to show for
different
# files or filename extensions...
AddIconByEncoding (CMP,/icons/compressed.png) x-compress x-gzip
AddIconByType (TXT,/icons/text.png) text/*
....
# DefaultIcon is which icon to show for files which do not have an
icon
DefaultIcon /icons/unknown.gif

# 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.shtml
# ReadmeName FOOTER.html
ReadmeName /FOOTER.html

# IndexIgnore is a set of filenames which directory indexing should
ignore
# and not include in the listing. Shell-style wildcarding is
permitted.
IndexIgnore .??* *~ *# HEADER* FOOTER* RCS CVS *,v *,t

</IfModule>
# End of indexing directives.


Note that the mod_include documentation <http://tinyurl.com/rfyr>
says:
"Both HeaderName and ReadmeName now treat Filename as a URI path
relative to the one used to access the directory being indexed. If
Filename begins with a slash, it will be taken to be relative to the
DocumentRoot."

$ grep -i DocumentRoot /etc/apache2/conf/apache2.conf
DocumentRoot /home/httpd/htdocs

But if I stick the HEADER.shtml in that directory and browse to
http://user1.stroller.uk.eu.org the contents of that header are not
shown before the file listing. "Ah!", you say, "but that's a virtual
host yada yada yada", and true, when I move HEADER.shtml to
/home/httpd/htdocs/user1.stroller.uk.eu.org/ it is displayed
correctly.

But right now, it's contents are only:
<!--#echo var="DOCUMENT_ROOT" -->
and it's output is "/home/httpd/htdocs/"

So I'm right confused. You can see that I've also got:
Alias /markup/ /home/httpd/markup/
in my configuration, but sticking the HEADER.shtml in there gives no
joy, either.

Is there any way I can put this file in such a place that all virtual
domains & all their subdirectories will reference it..?

Right now it seems that I can put a sym-link in the highest of each of
the virtuals' directories, and it works fine, but I'd prefer not to
have to, in case I forget sometime when I'm adding one.

Many thanks in advance for any suggestions,

Stroller.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:28 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0