Apache 2 problem with content negotiation

This is a discussion on Apache 2 problem with content negotiation within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi @all! I installed Apache 2.0.48 on a Linunx System, but I discovered a problem, as I tried ...


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 12-21-2003
Manuel
 
Posts: n/a
Default Apache 2 problem with content negotiation

Hi @all!

I installed Apache 2.0.48 on a Linunx System, but I discovered a problem, as
I tried to load the documenation. When I click on the docs link, the apache
loads the index.html. It seems that it is like a type-map, but apache didn't
load the correct index.html like index.html.en or index.html.de. Attached
you'll find a snipet of my httpd.conf. Can anybody give me a hint?

#
# This should be changed to the ServerRoot/manual/. The alias provides
# the manual, even if you choose to move your DocumentRoot. You may comment
# this out if you do not care for the documentation.
#
Alias /manual/ "/home/httpd/html/manual/"

<Directory "/home/httpd/html/manual">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Cheers, Manuel


  #2 (permalink)  
Old 12-22-2003
Joachim Ring
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

> I installed Apache 2.0.48 on a Linunx System, but I discovered a problem, as
> I tried to load the documenation. When I click on the docs link, the apache
> loads the index.html. It seems that it is like a type-map, but apache didn't
> load the correct index.html like index.html.en or index.html.de. Attached
> you'll find a snipet of my httpd.conf. Can anybody give me a hint?


iirc the apache docs is only available in english in the regular
distribution. only the start-page "It worked..." is multi-language.

does the start-page work with content-negotiation?

mind you, content-negotiation does _not_ automagically translate the
stuff, nice as this might be, so if there's only an index.html in
english, that's it.

joachim
  #3 (permalink)  
Old 12-22-2003
Manuel
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

"Joachim Ring" <jring@web.de> schrieb im Newsbeitrag
news:3ae246c1.0312211601.6ffcecec@posting.google.c om...
> > I installed Apache 2.0.48 on a Linunx System, but I discovered a

problem, as
> > I tried to load the documenation. When I click on the docs link, the

apache
> > loads the index.html. It seems that it is like a type-map, but apache

didn't
> > load the correct index.html like index.html.en or index.html.de.

Attached
> > you'll find a snipet of my httpd.conf. Can anybody give me a hint?

>
> iirc the apache docs is only available in english in the regular
> distribution. only the start-page "It worked..." is multi-language.
>
> does the start-page work with content-negotiation?
>
> mind you, content-negotiation does _not_ automagically translate the
> stuff, nice as this might be, so if there's only an index.html in
> english, that's it.
>
> joachim


Hi Joachim!

The docs for apache 2.0.48 contains several multi language sites. The
index.html looks like a type-map as follow:

URI: index.html.de
Content-Language: de
Content-type: text/html; charset=ISO-8859-1

URI: index.html.en
Content-Language: en
Content-type: text/html; charset=ISO-8859-1

URI: index.html.ja.jis
Content-Language: ja
Content-type: text/html; charset=ISO-2022-JP

URI: index.html.ko.euc-kr
Content-Language: ko
Content-type: text/html; charset=EUC-KR

URI: index.html.ru.koi8-r
Content-Language: ru
Content-type: text/html; charset=KOI8-R

And the manual directory contains those files:

-rw-r--r-- 1 webapps root 435 Aug 9 01:00 index.html
-rw-r--r-- 1 webapps root 7098 Aug 9 16:32 index.html.de
-rw-r--r-- 1 webapps root 7016 Aug 9 16:32 index.html.en
-rw-r--r-- 1 webapps root 7408 Aug 9 16:32 index.html.ja.jis
-rw-r--r-- 1 webapps root 6724 Aug 9 16:32 index.html.ko.euc-kr
-rw-r--r-- 1 webapps root 7057 Aug 9 16:32 index.html.ru.koi8-r

When I enter the URL http://foo/manual/index.html the index.html appears as
plain text, but apache doesn't load the appropriate index.html.de or
index.html.en. If I type the URL without .html e.g. http://foo/manuel/index
then apache loads the correct file for the desired language. I think it
should be a configuration problem of http.conf, but I don't know which one.
Thanks for help.
Cheers, Manuel



  #4 (permalink)  
Old 12-22-2003
Alan J. Flavell
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

On Mon, 22 Dec 2003, Manuel wrote:

> -rw-r--r-- 1 webapps root 435 Aug 9 01:00 index.html
> -rw-r--r-- 1 webapps root 7098 Aug 9 16:32 index.html.de
> -rw-r--r-- 1 webapps root 7016 Aug 9 16:32 index.html.en
> -rw-r--r-- 1 webapps root 7408 Aug 9 16:32 index.html.ja.jis
> -rw-r--r-- 1 webapps root 6724 Aug 9 16:32 index.html.ko.euc-kr
> -rw-r--r-- 1 webapps root 7057 Aug 9 16:32 index.html.ru.koi8-r
>
> When I enter the URL http://foo/manual/index.html the index.html appears


That looks like the expected behaviour to me: an explicit file
match always wins - no negotiation takes place; AFAIK that is true in
Apache 2 as it was in 1.3.*.

> as plain text,


Not sure about that ;-)

> but apache doesn't load the appropriate index.html.de or
> index.html.en. If I type the URL without .html e.g. http://foo/manuel/index
> then apache loads the correct file for the desired language.


That behaviour seems to make sense, unless I am missing the point
somehow. There is no file called "index", so the request causes
content negotiation. The language preferences then cause a better
match for the file with an acceptable language (index.html.XX), than
for the one with no language extension (index.html).

What is the purpose of index.html? What does it contain? (Sorry, I
don't have the Apache 2 distribution here at home). My guess is that
it would be better to remove it, or maybe rename it index.html.html
  #5 (permalink)  
Old 12-22-2003
Ray Pearce
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

Manuel wrote:
> Hi Joachim!
>
> The docs for apache 2.0.48 contains several multi language sites. The
> index.html looks like a type-map as follow:
>
> URI: index.html.de
> Content-Language: de
> Content-type: text/html; charset=ISO-8859-1
>
> URI: index.html.en
> Content-Language: en
> Content-type: text/html; charset=ISO-8859-1
>
> URI: index.html.ja.jis
> Content-Language: ja
> Content-type: text/html; charset=ISO-2022-JP
>
> URI: index.html.ko.euc-kr
> Content-Language: ko
> Content-type: text/html; charset=EUC-KR
>
> URI: index.html.ru.koi8-r
> Content-Language: ru
> Content-type: text/html; charset=KOI8-R
>
> And the manual directory contains those files:
>
> -rw-r--r-- 1 webapps root 435 Aug 9 01:00 index.html
> -rw-r--r-- 1 webapps root 7098 Aug 9 16:32 index.html.de
> -rw-r--r-- 1 webapps root 7016 Aug 9 16:32 index.html.en
> -rw-r--r-- 1 webapps root 7408 Aug 9 16:32
> index.html.ja.jis
> -rw-r--r-- 1 webapps root 6724 Aug 9 16:32
> index.html.ko.euc-kr
> -rw-r--r-- 1 webapps root 7057 Aug 9 16:32
> index.html.ru.koi8-r
>
> When I enter the URL http://foo/manual/index.html the index.html
> appears as plain text, but apache doesn't load the appropriate
> index.html.de or index.html.en. If I type the URL without .html e.g.
> http://foo/manuel/index then apache loads the correct file for the
> desired language. I think it should be a configuration problem of
> http.conf, but I don't know which one. Thanks for help.
> Cheers, Manuel


If the index.html file contains a type-map, it should have the
suffix .var appended to its name.
You should also have:

AddHandler type-map .var

in your configuration.


  #6 (permalink)  
Old 12-22-2003
Nick Kew
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

In article <bs6h60$h8p$1$8300dec7@news.demon.co.uk>, one of infinite monkeys
at the keyboard of "Ray Pearce" <ray.pearce@macro4NOUCE.com> wrote:

> If the index.html file contains a type-map, it should have the
> suffix .var appended to its name.
> You should also have:
>
> AddHandler type-map .var
>
> in your configuration.


Indeed. It'll also work (though slower) if you simply delete the .html
files and leave it to select the variants directly.

This appears to be a distribution bug in Apache at the moment;
must raise it on #apache.

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
  #7 (permalink)  
Old 12-22-2003
Alan J. Flavell
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

On Mon, 22 Dec 2003, Nick Kew wrote:

> In article <bs6h60$h8p$1$8300dec7@news.demon.co.uk>, one of infinite monkeys
> at the keyboard of "Ray Pearce" <ray.pearce@macro4NOUCE.com> wrote:
>
> > If the index.html file contains a type-map, it should have the
> > suffix .var appended to its name.


Shouldn't it just be index.var ?

> > You should also have:
> >
> > AddHandler type-map .var
> >
> > in your configuration.

>
> Indeed.


[..]
> This appears to be a distribution bug in Apache at the moment;
> must raise it on #apache.


Thanks, both, for clearing that up. I hadn't grasped what that
"index.html" was, hence my confuddled posting (which I'm now going
through the motions of superseding - not that Google-groups seems to
care for such niceties).

cheers
  #8 (permalink)  
Old 12-23-2003
Nick Kew
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

In article <bs4k1l$2no4$1@ulysses.news.tiscali.de>, one of infinite monkeys
at the keyboard of "Manuel" <hedrich1@gmx.net> wrote:

> (chop report)


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

It's a bug that won't bite with a "clean" install, but bites when
you upgrade from an older version or perhaps with certain packaged
versions. What did you use?

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
  #9 (permalink)  
Old 12-23-2003
Manuel
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

Hi Pals!

I know that it looks like a *.var file, but in this group I found a thread
with the similar problem:

http://groups.google.de/groups?hl=de...Google%2BSuche

And it seems that it's only a config problem. Sure, I can delete all *.html
files or rename it to *.var. But it's quite funny, when I enter the url like
http://foo/manuel/index without suffix *.html it works correctly. Why?
Cheers, Manuel

"Alan J. Flavell" <flavell@ph.gla.ac.uk> schrieb im Newsbeitrag
news:Pine.LNX.4.53.0312221544440.28985@ppepc56.ph. gla.ac.uk...
> On Mon, 22 Dec 2003, Nick Kew wrote:
>
> > In article <bs6h60$h8p$1$8300dec7@news.demon.co.uk>, one of infinite

monkeys
> > at the keyboard of "Ray Pearce" <ray.pearce@macro4NOUCE.com> wrote:
> >
> > > If the index.html file contains a type-map, it should have the
> > > suffix .var appended to its name.

>
> Shouldn't it just be index.var ?
>
> > > You should also have:
> > >
> > > AddHandler type-map .var
> > >
> > > in your configuration.

> >
> > Indeed.

>
> [..]
> > This appears to be a distribution bug in Apache at the moment;
> > must raise it on #apache.

>
> Thanks, both, for clearing that up. I hadn't grasped what that
> "index.html" was, hence my confuddled posting (which I'm now going
> through the motions of superseding - not that Google-groups seems to
> care for such niceties).
>
> cheers



  #10 (permalink)  
Old 12-23-2003
Alan J. Flavell
 
Posts: n/a
Default Re: Apache 2 problem with content negotiation

On Tue, 23 Dec 2003, Manuel set sail upon usenet atop a fullquote:

> But it's quite funny, when I enter the url like
> http://foo/manuel/index without suffix *.html it works correctly. Why?


Because it triggers content negotiation.

Whereas if you specify index.html, the specified file exists, and so
it is returned without triggering content negotiation.

Now that I've seen the bugzilla discussion cited by Nick, I think the
missing pieces have also fallen into place in my understanding. A
pity, though, that bugzilla is displaying yard-wide single line
paragraphs!

 


Thread Tools
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

vB 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 05:55 PM.


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