DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15923>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15923

Directory Index, Content Negotiation Does Not Work in <DirectoryIndex> under 
Apache 2.0.43

           Summary: Directory Index, Content Negotiation Does Not Work in
                    <DirectoryIndex> under Apache 2.0.43
           Product: Apache httpd-2.0
           Version: 2.0.43
          Platform: PC
               URL: http://rinse.wov.idv.tw:50080/
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


I had built a standard httpd, which includes mod_mime, mod_dir,
mod_autoindex and mod_negotiation.  Also I was using content negotiation on my
multi-lingual website.  But content negotiation failed on the directory index
when it is under some <DirectoryMatch>.

    I tried to build a simpliest environment.  I built Apache as:

[EMAIL PROTECTED] ~ % /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
[EMAIL PROTECTED] ~ %

    My document root is:

[EMAIL PROTECTED] ~ % ls /var/tmp/htdocs
index.html.en  index.html.zh-tw
[EMAIL PROTECTED] ~ %

    If my httpd.conf is:

[EMAIL PROTECTED] ~ % cat /etc/apache/httpd2.conf
User            nobody
Group           nogroup
DocumentRoot    /var/tmp/htdocs
PidFile         /var/run/httpd2.pid
Listen          50080
LogLevel        debug
ErrorLog        /var/log/apache/error_log
Options         +MultiViews
DirectoryIndex  index.html

AddLanguage             en              .en
AddLanguage             zh-tw           .zh-tw
LanguagePriority        zh-tw en
[EMAIL PROTECTED] ~ % /usr/sbin/httpd2 -t -f /etc/apache/httpd2.conf
Syntax OK
[EMAIL PROTECTED] ~ %

    Then I can work properly.

[EMAIL PROTECTED] ~ % lynx -dump http://localhost:50080/
                            Test Page index.html.en

   This is test page index.html.en.
[EMAIL PROTECTED] ~ % lynx -dump http://localhost:50080/index.html
                            Test Page index.html.en

   This is test page index.html.en.
[EMAIL PROTECTED] ~ %

    But if I add an arbitrarily <DirectoryMatch> there:

[EMAIL PROTECTED] ~ % cat /etc/apache/httpd2.conf
User            nobody
Group           nogroup
DocumentRoot    /var/tmp/htdocs
PidFile         /var/run/httpd2.pid
Listen          50080
LogLevel        debug
ErrorLog        /var/log/apache/error_log
Options         +MultiViews
DirectoryIndex  index.html

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

<DirectoryMatch /var/tmp/htdocs>
</DirectoryMatch>
[EMAIL PROTECTED] ~ % /usr/sbin/httpd2 -t -f /etc/apache/httpd2.conf
Syntax OK
[EMAIL PROTECTED] ~ %

    Then it breaks the content-negotiation on the directory index:

[EMAIL PROTECTED] ~ % lynx -dump http://localhost:50080/
                                  Index of /

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

References

   1. http://localhost:50080/index.html.en
   2. http://localhost:50080/index.html.zh-tw
[EMAIL PROTECTED] ~ % lynx -dump http://localhost:50080/index.html
                            Test Page index.html.en

   This is test page index.html.en.
[EMAIL PROTECTED] ~ % cp /var/tmp/htdocs/index.html.en 
/var/tmp/htdocs/index.html
[EMAIL PROTECTED] ~ % lynx -dump http://localhost:50080/

                            Test Page index.html.en

   This is test page index.html.en.
[EMAIL PROTECTED] ~ % 

    It breaks if directory index and content negotiation work together
under some <DirectoryMatch>.  But they work well seperately.

    My environment is Linux 2.4.20, Debian 3.0r0, gcc 3.2.1, glibc 2.3.1.  But I
have also tested it on an Linux 2.4.20, Red Hat 7.3, gcc 3.2.1, glibc 2.2.5;
Linux 2.4.20, Red Hat 7.3, gcc 2.96, glibc 2.2.5; Linux 2.4.20, Debian 3.0r0,
gcc 2.95, glibc 2.2.5.  Please tell me if you have any question about the above
procedure.

    Please tell me if you need more infomation or help on this problem.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to