httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From imacat <ima...@mail.imacat.idv.tw>
Subject [users@httpd] Content Negotiation with <DirectoryMatch> in Apache 2.0.43
Date Thu, 01 Jan 1970 00:00:00 GMT
Dear all,

    I believe I did not found anything related to this problem.  Maybe I
have missed something somewhere.

    I cannot do content negotiation with <DirectoryMatch> in Apache
2.0.43.  My testing httpd.conf is:

imacat@rinse ~ % cat /etc/apache/httpd2.conf-test
User nobody
Group nogroup
DocumentRoot /var/tmp/htdocs
PidFile /var/run/httpd2.pid
Listen 50080
ErrorLog /var/log/apache/error_log
Options +MultiViews
DirectoryIndex index.html

AddLanguage en          .en
AddLanguage zh-tw       .zh-tw
AddLanguage zh-cn       .zh-cn
LanguagePriority zh-tw zh-cn en

<DirectoryMatch /var/tmp/htdocs>
</DirectoryMatch>
imacat@rinse ~ % 

    My document root is:

imacat@rinse ~ % ls /var/tmp/htdocs -l
total 12
-rw-r--r--    1 imacat   root          517 Dec 25 23:34 index.html.en
lrwxrwxrwx    1 imacat   root           13 Dec 25 23:36 index.html.html -> index.html.en
-rw-r--r--    1 imacat   root          504 Dec 25 23:35 index.html.zh-cn
-rw-r--r--    1 imacat   root          500 Dec 25 23:35 index.html.zh-tw
imacat@rinse ~ % 

    My httpd is:

imacat@rinse ~ % /usr/sbin/httpd2 -l
Compiled in modules:
  core.c
  worker.c
  http_core.c
  mod_mime.c
  mod_autoindex.c
  mod_negotiation.c
  mod_dir.c
imacat@rinse ~ % 

    After starting /usr/sbin/httpd2 -f /etc/apache/httpd2.conf-test, and
try to connect, I get:

imacat@rinse ~ % lynx -dump http://rinse:50080/
                                  Index of /

     * [1]index.html.en
     * [2]index.html.html
     * [3]index.html.zh-cn
     * [4]index.html.zh-tw

References

   1. http://rinse:50080/index.html.en
   2. http://rinse:50080/index.html.html
   3. http://rinse:50080/index.html.zh-cn
   4. http://rinse:50080/index.html.zh-tw
imacat@rinse ~ %

    This is strange.  It should display index.html.html.  And if I
comment out <DirectoryMatch>:

imacat@rinse ~ % cat /etc/apache/httpd2.conf-test
User nobody
Group nogroup
DocumentRoot /var/tmp/htdocs
PidFile /var/run/httpd2.pid
Listen 50080
ErrorLog /var/log/apache/error_log
Options +MultiViews
DirectoryIndex index.html

AddLanguage en          .en
AddLanguage zh-tw       .zh-tw
AddLanguage zh-cn       .zh-cn
LanguagePriority zh-tw zh-cn en

#<DirectoryMatch /var/tmp/htdocs>
#</DirectoryMatch>
imacat@rinse ~ % 

    And try again, I'll get:

imacat@rinse ~ % lynx -dump http://rinse:50080/
                                   Test Page

   This is a test page.
imacat@rinse ~ % 

    which is the correct answer.

    This had never happened before in Apache 1.3.x (at least in my
experience).  I'm using content negotiation throughout my website, along
with several <DirectoryMatch>.  I cannot switch to Apache 2 now for this
reason.  This does not happen on <Directory> or <LocationMatch>.  It
only seems to be a problem of <DirectoryMatch>

    I don't know if anyone has noticed this, or if I have missed
something in the Apache 2 documentation.  I have tried some search on
the mailing list archives, but found nothing.  Can anyone give me a hint
on this?  Or is it really a bug?

    Any help would be greatly appreciated.  Please tell me whoever needs
more infomation on this.

--
Best regards,
imacat ^_*'
imacat@mail.imacat.idv.tw
PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt

<<Woman's Voice>> News: http://www.wov.idv.tw/
Tavern IMACAT's: http://www.imacat.idv.tw/
TLUG List Manager: http://www.linux.org.tw/mailman/listinfo/tlug

Mime
View raw message