From 96a8ea0ebbd93a8cc56222234d4a5815b30a3934 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Sep 2010 12:58:37 -0400 Subject: add --- ...:_apache_config_serves_index.rss_for_index.mdwn | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn (limited to 'doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn') diff --git a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn new file mode 100644 index 000000000..e6e1b57a8 --- /dev/null +++ b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn @@ -0,0 +1,28 @@ +The apache config documented in [[plugins/po]] has a subtle bug. It works +until a site gets an index.atom or index.rss file. (Acutally, with po +enabled, they're called index.en.atom or index.en.rss etc, but the result +is the same). + +Then, when wget, curl, or w3m is pointed at http://site/, apache serves +up the rss/atom file rather than the index page. + +Analysis: + +* /etc/mime.types gives mime types to .rss and .atom files +* `mod_negotiation`'s MultiViews allows any file with a mime type to be + served up via content negotiation, if the client requests that type. +* wget etc send "Accept: */*" to accept all content types. Compare + with firefox, which sends "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*" +* So apache has a tie between a html encoded Enlish file, and a rss encoded + English file and the client has no preference. In a tie, apache will serve up the + *smallest* file, which tends to be the rss file. (Apache's docs say it uses that + strange criteria to break ties; see ) + +The only way I have found to work around this problem is to remove +atom and rss from /etc/mime.types. Of course, that has other undesirable +results. + +I wonder if it would be worth making the po plugin generate apache +[type map files](http://httpd.apache.org/docs/2.0/mod/mod_negotiation.html#typemaps). +That should avoid this problem. +--[[Joey]] -- cgit v1.2.3 From 4079c06be22d0eb31bd0bead4b8f53a9831804e9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Sep 2010 13:03:33 -0400 Subject: format --- doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn') diff --git a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn index e6e1b57a8..bf5973325 100644 --- a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn +++ b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn @@ -11,8 +11,8 @@ Analysis: * /etc/mime.types gives mime types to .rss and .atom files * `mod_negotiation`'s MultiViews allows any file with a mime type to be served up via content negotiation, if the client requests that type. -* wget etc send "Accept: */*" to accept all content types. Compare - with firefox, which sends "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*" +* wget etc send `Accept: */*` to accept all content types. Compare + with firefox, which sends `Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*` * So apache has a tie between a html encoded Enlish file, and a rss encoded English file and the client has no preference. In a tie, apache will serve up the *smallest* file, which tends to be the rss file. (Apache's docs say it uses that -- cgit v1.2.3 From 26c38c8049e3e8794984079b3b6d4c22ba888d3a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Sep 2010 15:09:14 -0400 Subject: better fix developed on #httpd channel --- doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn') diff --git a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn index bf5973325..7acbfe82d 100644 --- a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn +++ b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn @@ -26,3 +26,11 @@ I wonder if it would be worth making the po plugin generate apache [type map files](http://httpd.apache.org/docs/2.0/mod/mod_negotiation.html#typemaps). That should avoid this problem. --[[Joey]] + +Update: A non-intrusive fix is to add this to apache configuration. +This tunes the "quality" of the rss and atom files, in an apparently currently +undocumented way (though someone on #httpd suggested it should get documented). +Result is that apache will prefer serving index.html. --[[Joey]] + + AddType application/rss+xml;qs=0.8 .rss + AddType application/atom+xml;qs=0.8 .atom -- cgit v1.2.3 From ea487472ed05f633e3cd9479b933656309c0d3c8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Sep 2010 18:48:46 -0400 Subject: document settings needed to fix bug --- doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn | 2 +- doc/plugins/po.mdwn | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn') diff --git a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn index 7acbfe82d..a2b68c4b1 100644 --- a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn +++ b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn @@ -30,7 +30,7 @@ That should avoid this problem. Update: A non-intrusive fix is to add this to apache configuration. This tunes the "quality" of the rss and atom files, in an apparently currently undocumented way (though someone on #httpd suggested it should get documented). -Result is that apache will prefer serving index.html. --[[Joey]] +Result is that apache will prefer serving index.html. --[[Joey]] [[done]] AddType application/rss+xml;qs=0.8 .rss AddType application/atom+xml;qs=0.8 .atom diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index ca1775f6e..f91e44ea3 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -117,8 +117,13 @@ serve any page in the client's preferred language, if available. Add 'Options MultiViews' to the wiki directory's configuration in Apache. -When `usedirs` is enabled, one has to set `DirectoryIndex index` for -the wiki context. +When `usedirs` is enabled, you should also set `DirectoryIndex index`. + +These settings are also recommended, in order to avoid serving up rss files +as index pages: + + AddType application/rss+xml;qs=0.8 .rss + AddType application/atom+xml;qs=0.8 .atom For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/content-negotiation.html). -- cgit v1.2.3