You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jason Keltz <ja...@cse.yorku.ca> on 2007/04/09 17:41:47 UTC
[users@httpd] strange behaviour of Readme postamble
Hi.
I'm experiencing some strange behaviour with the Header/Readme
pre/postamble directives on our Apache 2.2.X server.
One of our users was complaining that he had placed two totally text
README files in two separate directories on our server. When he visited
the first directory in his web browser, he saw the directory contents
followed by his "README" file. However, when he visited the second
directory, the contents of the README file was not displayed.
File/directory permission was not an issue. When I looked into the
problem, I found that if a README (or HEADER) file contains html, it
works great. However, if the file is plain text and does not include
the word "the" that the file would not be displayed. For example, if I
create a README file containing only the word "the", the file is
displayed when I visit the directory. However, if I remove any one
letters from "the", the file is not displayed. This seems really really
weird, and I'm probably missing something very silly here. It looks
like this is handled by the "emit_tail" function which should display
anything text/*. The question is, how do I determine what the web
server considers the content as? Anyone have any experience with this
weird behaviour?
Jas.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] strange behaviour of Readme postamble
Posted by Joshua Slive <jo...@slive.ca>.
On 4/10/07, Jason Keltz <ja...@cse.yorku.ca> wrote:
> Actually, neither is the perfect solution. If I change the README name
> to README.txt, then users can't use HTML readme files. The same occurs
> if I force the type on README. The *real* solution, of course, would be
> for the problem to be fixed in the web server software. There is
> already functionality for a "DefaultType", and that DefaultType should
> be used when the type of a file cannot be recognized.
I don't know why the DefaultType isn't having the desired effect here;
yes, that could be considered a bug.
But the rest of you comment doesn't make any sense to me. You can't
mix HTML and plain test files under the same URL unless you use
MultiViews. Having DefaultType affect the Includability wouldn't
change that.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] strange behaviour of Readme postamble
Posted by Jason Keltz <ja...@cse.yorku.ca>.
On 04/09/07 17:27, Joshua Slive wrote:
> On 4/9/07, Jason Keltz <ja...@cse.yorku.ca> wrote:
>
>> As it happens, mod_mime_magic code maps "The" and "the" to L_ENG.
>> There's a table that says "English text" -> "text/plain". As a result,
>> if you don't have the word "the" in the file, and the file is not html,
>> there doesn't seem to be anything else that would distinguish this file
>> as "text/plain". There *is* a "DefaultType" directive which is by
>> default set to "text/plain", and this does indeed work since the web
>> browser gets served the file as text/plain when called directly, but
>> this looks like it is done "after" mod_mime_magic has returned a
>> "declined" status and hence has not displayed the file. It seems like
>> an underlying bug.
>
> The easiest thing to do is simply rename README to README.txt.
> Otherwise, you can use
> <Files README>
> ForceType text/plain
> </Files>
Hi Joshua,
Actually, neither is the perfect solution. If I change the README name
to README.txt, then users can't use HTML readme files. The same occurs
if I force the type on README. The *real* solution, of course, would be
for the problem to be fixed in the web server software. There is
already functionality for a "DefaultType", and that DefaultType should
be used when the type of a file cannot be recognized.
Jason.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] strange behaviour of Readme postamble
Posted by Joshua Slive <jo...@slive.ca>.
On 4/9/07, Jason Keltz <ja...@cse.yorku.ca> wrote:
> As it happens, mod_mime_magic code maps "The" and "the" to L_ENG.
> There's a table that says "English text" -> "text/plain". As a result,
> if you don't have the word "the" in the file, and the file is not html,
> there doesn't seem to be anything else that would distinguish this file
> as "text/plain". There *is* a "DefaultType" directive which is by
> default set to "text/plain", and this does indeed work since the web
> browser gets served the file as text/plain when called directly, but
> this looks like it is done "after" mod_mime_magic has returned a
> "declined" status and hence has not displayed the file. It seems like
> an underlying bug.
The easiest thing to do is simply rename README to README.txt.
Otherwise, you can use
<Files README>
ForceType text/plain
</Files>
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] strange behaviour of Readme postamble
Posted by Jason Keltz <ja...@cse.yorku.ca>.
On 04/09/07 13:19, Jason Keltz wrote:
> On 04/09/07 12:56, Joshua Slive wrote:
>> On 4/9/07, Jason Keltz <ja...@cse.yorku.ca> wrote:
>>> Hi.
>>>
>>> I'm experiencing some strange behaviour with the Header/Readme
>>> pre/postamble directives on our Apache 2.2.X server.
>>>
>>> One of our users was complaining that he had placed two totally text
>>> README files in two separate directories on our server. When he visited
>>> the first directory in his web browser, he saw the directory contents
>>> followed by his "README" file. However, when he visited the second
>>> directory, the contents of the README file was not displayed.
>>> File/directory permission was not an issue. When I looked into the
>>> problem, I found that if a README (or HEADER) file contains html, it
>>> works great. However, if the file is plain text and does not include
>>> the word "the" that the file would not be displayed. For example, if I
>>> create a README file containing only the word "the", the file is
>>> displayed when I visit the directory. However, if I remove any one
>>> letters from "the", the file is not displayed. This seems really really
>>> weird, and I'm probably missing something very silly here. It looks
>>> like this is handled by the "emit_tail" function which should display
>>> anything text/*. The question is, how do I determine what the web
>>> server considers the content as? Anyone have any experience with this
>>> weird behaviour?
>>
>> Sounds like mod_mime_magic might be getting in the way.
>>
>> To see what content-type apache is seeing, simply request the README
>> file directly (ie http://yoursite.example.com/dir/README) and examine
>> the Content-Type http response header.
>
> Hi.
>
> The web browser says that "Content type" is "text/plain" whether I have
> "the" in the file or not!
As it happens, mod_mime_magic code maps "The" and "the" to L_ENG.
There's a table that says "English text" -> "text/plain". As a result,
if you don't have the word "the" in the file, and the file is not html,
there doesn't seem to be anything else that would distinguish this file
as "text/plain". There *is* a "DefaultType" directive which is by
default set to "text/plain", and this does indeed work since the web
browser gets served the file as text/plain when called directly, but
this looks like it is done "after" mod_mime_magic has returned a
"declined" status and hence has not displayed the file. It seems like
an underlying bug.
Jason.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] strange behaviour of Readme postamble
Posted by Jason Keltz <ja...@cse.yorku.ca>.
On 04/09/07 12:56, Joshua Slive wrote:
> On 4/9/07, Jason Keltz <ja...@cse.yorku.ca> wrote:
>> Hi.
>>
>> I'm experiencing some strange behaviour with the Header/Readme
>> pre/postamble directives on our Apache 2.2.X server.
>>
>> One of our users was complaining that he had placed two totally text
>> README files in two separate directories on our server. When he visited
>> the first directory in his web browser, he saw the directory contents
>> followed by his "README" file. However, when he visited the second
>> directory, the contents of the README file was not displayed.
>> File/directory permission was not an issue. When I looked into the
>> problem, I found that if a README (or HEADER) file contains html, it
>> works great. However, if the file is plain text and does not include
>> the word "the" that the file would not be displayed. For example, if I
>> create a README file containing only the word "the", the file is
>> displayed when I visit the directory. However, if I remove any one
>> letters from "the", the file is not displayed. This seems really really
>> weird, and I'm probably missing something very silly here. It looks
>> like this is handled by the "emit_tail" function which should display
>> anything text/*. The question is, how do I determine what the web
>> server considers the content as? Anyone have any experience with this
>> weird behaviour?
>
> Sounds like mod_mime_magic might be getting in the way.
>
> To see what content-type apache is seeing, simply request the README
> file directly (ie http://yoursite.example.com/dir/README) and examine
> the Content-Type http response header.
Hi.
The web browser says that "Content type" is "text/plain" whether I have
"the" in the file or not!
Jason.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] strange behaviour of Readme postamble
Posted by Joshua Slive <jo...@slive.ca>.
On 4/9/07, Jason Keltz <ja...@cse.yorku.ca> wrote:
> Hi.
>
> I'm experiencing some strange behaviour with the Header/Readme
> pre/postamble directives on our Apache 2.2.X server.
>
> One of our users was complaining that he had placed two totally text
> README files in two separate directories on our server. When he visited
> the first directory in his web browser, he saw the directory contents
> followed by his "README" file. However, when he visited the second
> directory, the contents of the README file was not displayed.
> File/directory permission was not an issue. When I looked into the
> problem, I found that if a README (or HEADER) file contains html, it
> works great. However, if the file is plain text and does not include
> the word "the" that the file would not be displayed. For example, if I
> create a README file containing only the word "the", the file is
> displayed when I visit the directory. However, if I remove any one
> letters from "the", the file is not displayed. This seems really really
> weird, and I'm probably missing something very silly here. It looks
> like this is handled by the "emit_tail" function which should display
> anything text/*. The question is, how do I determine what the web
> server considers the content as? Anyone have any experience with this
> weird behaviour?
Sounds like mod_mime_magic might be getting in the way.
To see what content-type apache is seeing, simply request the README
file directly (ie http://yoursite.example.com/dir/README) and examine
the Content-Type http response header.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org