|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'm trying to get optimal results for files whatever.ps.gz (to take an example). If it's relevant, Apache version is 2.0.46-something, as distributed by RHEL. What I think I want is for these files to be sent with: Content-type: application/postscript Content-encoding: gzip (or should that still be x-gzip ?) OK, I went into this thinking that I knew what to do, but soon I was finding myself at Witt's End. By default, I found that I was getting: Content-Type: application/x-gzip Content-Encoding: x-gzip Indeed, the x-gzip content-encoding is defined in the main configuration (default setting of httpd.conf). I thought maybe I could persuade it to deliver application/postscript if I used: RemoveType .gz in the applicable .htaccess file. Well, the server happily swallowed the directive, but it made no difference to the content-type being served out! It was still Content-Type: application/x-gzip I'm sure that my AllowOverride and such is OK, otherwise the directives would be rejected as in error, surely? Then I tried a bit of a web search and found this FAQ: http://www.math.uwaterloo.ca/mfcf/fa...ures_ps_gz.faq This suggests e.g: <Files *.html.gz> AddEncoding x-gzip .gz AddType text/html .gz </Files> <Files *.ps.gz> AddEncoding x-gzip .gz AddType application/postscript .gz </Files> and so on. That looks like rather a kludge, but I tried it and it did what was wanted. Fine, as far as it goes... But isn't there a more satisfactory way to configure this, please? It must be a frequently needed feature, no? thanks -- |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Jul 2006, Alan J. Flavell wrote:
> I'm trying to get optimal results for files whatever.ps.gz (to take an > example). If it's relevant, Apache version is 2.0.46-something, as > distributed by RHEL. > > What I think I want is for these files to be sent with: > > Content-type: application/postscript > Content-encoding: gzip Is this a change in Apache 2.0? With Apache 1.3.31, I do get | Content-Type: application/postscript | Content-Encoding: gzip without doing anything in my own .htaccess. > I thought maybe I could persuade it to deliver application/postscript > if I used: > RemoveType .gz How about using some other extension than ".gz"? |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Jul 2006, Alan J. Flavell wrote:
> I'm trying to get optimal results for files whatever.ps.gz (to take an > example). If it's relevant, Apache version is 2.0.46-something, as > distributed by RHEL. > > What I think I want is for these files to be sent with: > > Content-type: application/postscript > Content-encoding: gzip Is this a change in Apache 2.0? With Apache 1.3.31, I do get | Content-Type: application/postscript | Content-Encoding: gzip without doing anything in my own .htaccess. > I thought maybe I could persuade it to deliver application/postscript > if I used: > RemoveType .gz How about using some other extension than ".gz"? |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Jul 2006, Andreas Prilop wrote:
> On Tue, 18 Jul 2006, Alan J. Flavell wrote: > > > What I think I want is for these files to be sent with: > > > > Content-type: application/postscript > > Content-encoding: gzip > > Is this a change in Apache 2.0? With Apache 1.3.31, I do get > > | Content-Type: application/postscript > | Content-Encoding: gzip > > without doing anything in my own .htaccess. I suppose that might explain why I wasn't aware of the problem before now. > How about using some other extension than ".gz"? I'm afraid not. The files already exist in fairly large numbers under control of another, and the users will expect them to come with ..ps.gz extensions by long-standing custom and convention. It's my job to make that happen. As I showed, I *do* have a workable answer, even if it still feels kludgy. thanks -- If the crash doesn't occur immediately, the [development] cycle is broken, and the result is called a release. -- detha, in the monastery. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Jul 2006, Andreas Prilop wrote:
> On Tue, 18 Jul 2006, Alan J. Flavell wrote: > > > What I think I want is for these files to be sent with: > > > > Content-type: application/postscript > > Content-encoding: gzip > > Is this a change in Apache 2.0? With Apache 1.3.31, I do get > > | Content-Type: application/postscript > | Content-Encoding: gzip > > without doing anything in my own .htaccess. I suppose that might explain why I wasn't aware of the problem before now. > How about using some other extension than ".gz"? I'm afraid not. The files already exist in fairly large numbers under control of another, and the users will expect them to come with ..ps.gz extensions by long-standing custom and convention. It's my job to make that happen. As I showed, I *do* have a workable answer, even if it still feels kludgy. thanks -- If the crash doesn't occur immediately, the [development] cycle is broken, and the result is called a release. -- detha, in the monastery. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Jul 2006, Alan J. Flavell wrote:
>> Is this a change in Apache 2.0? With Apache 1.3.31, I do get >> >> | Content-Type: application/postscript >> | Content-Encoding: gzip > > I suppose that might explain why I wasn't aware of the problem before > now. However, in http://www.math.uwaterloo.ca/mfcf/faq/www_author.html there is no reference to Apache 2.0 - only to Apache 1.3. Why was the workaround necessary for them? And what do the Apache docs say? |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Alan J. Flavell wrote:
> I'm trying to get optimal results for files whatever.ps.gz (to take an > example). If it's relevant, Apache version is 2.0.46-something, as > distributed by RHEL. Does it have a configuration section looking something like # # AddType allows you to add to or override the MIME configuration # file mime.types for specific file types. # #AddType application/x-gzip .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # Despite the name similarity, the following Add* directives have # nothing to do with the FancyIndexing customization directives above. # #AddEncoding x-compress .Z #AddEncoding gzip .gz .tgz # # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz Fixing that should work just fine. A bug report complaining about silly defaults can't hurt. -- Nick Kew |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Alan J. Flavell wrote:
> I'm trying to get optimal results for files whatever.ps.gz (to take an > example). If it's relevant, Apache version is 2.0.46-something, as > distributed by RHEL. Does it have a configuration section looking something like # # AddType allows you to add to or override the MIME configuration # file mime.types for specific file types. # #AddType application/x-gzip .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # Despite the name similarity, the following Add* directives have # nothing to do with the FancyIndexing customization directives above. # #AddEncoding x-compress .Z #AddEncoding gzip .gz .tgz # # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz Fixing that should work just fine. A bug report complaining about silly defaults can't hurt. -- Nick Kew |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
|
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Jul 2006, Nick Kew wrote:
> Alan J. Flavell wrote: > > I'm trying to get optimal results for files whatever.ps.gz (to > > take an example). If it's relevant, Apache version is > > 2.0.46-something, as distributed by RHEL. > > Does it have a configuration section looking something like [...] > # AddEncoding allows you to have certain browsers uncompress > # information on the fly. Note: Not all browsers support this. > # Despite the name similarity, the following Add* directives have > # nothing to do with the FancyIndexing customization directives above. > # > #AddEncoding x-compress .Z > #AddEncoding gzip .gz .tgz > # > # If the AddEncoding directives above are commented-out, then you > # probably should define those extensions to indicate media types: > # > AddType application/x-compress .Z > AddType application/x-gzip .gz .tgz Indeed it does. Could I suspect that the "Note: Not all browsers support this" is now very old, and could more usefully say something like "Note: a few browsers, by now little-used, don't support this." But I'm puzzled that the RemoveType directive in the .htaccess didn't take away the effect of the AddType directive in the main configuration: the server evidently swallowed it without protest, but "nothing happened". > Fixing that should work just fine. A bug report complaining about > silly defaults can't hurt. If you mean that this is also the Apache distributed default, then OK. But if this is some kind of RHEL-tailored httpd.conf, then I have to admit we are using Scientific Linux, which is a clone of RHEL, meaning that I have no right to submit bugs to RH. thanks By the way, while this topic is active, I seem to recall at least one browser which, when presented with a file glorp.something.gz to download, with content-type application/something and content-encoding gzip, then the browser would dutifully unzip the object and then store it in a file named, by default, glorp.something.gz When the file was then presented to the "something" application (I think it was tar, but I could be wrong), the application said (in effect) I can't process that, the filename says that it's gzipped, but I can see that it isn't. Any chance that someone recognises this effect, and can say whether the situation has changed? (Just a shot in the dark - I didn't think it justified starting a new thread.) |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
Alan J. Flavell wrote:
> By the way, while this topic is active, I seem to recall at least one > browser which, when presented with a file glorp.something.gz to > download, with content-type application/something and content-encoding > gzip, then the browser would dutifully unzip the object and then store > it in a file named, by default, glorp.something.gz > > When the file was then presented to the "something" application (I > think it was tar, but I could be wrong), the application said (in > effect) I can't process that, the filename says that it's gzipped, but > I can see that it isn't. I've definitely encountered that. But I can't remember the circumstances, and I don't think it was recent. Was it from the panic days of Netscape? -- Nick Kew |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
Alan J. Flavell wrote:
> By the way, while this topic is active, I seem to recall at least one > browser which, when presented with a file glorp.something.gz to > download, with content-type application/something and content-encoding > gzip, then the browser would dutifully unzip the object and then store > it in a file named, by default, glorp.something.gz > > When the file was then presented to the "something" application (I > think it was tar, but I could be wrong), the application said (in > effect) I can't process that, the filename says that it's gzipped, but > I can see that it isn't. I've definitely encountered that. But I can't remember the circumstances, and I don't think it was recent. Was it from the panic days of Netscape? -- Nick Kew |
|
![]() |
| Outils de la discussion | |
|
|