Forum Moderators: phranque

Message Too Old, No Replies

Making Apache unzip a .gz file

Works in production, not with 2.2 new config.

         

sublime1

6:39 pm on Nov 1, 2006 (gmt 0)

10+ Year Member



Hi --

We're using Google sitemaps and have our sitemaps zipped, so a file might be called sitemap.xml.gz. I can test this in my browser, and see the contents of the XML. Nice.

But in my local configuration, the browser treats the file as though it is a .gz that should be downloaded, and opens the download box (same for IE and FF).

We're running Apache 2.0.58 in production, and I am running 2.2.3 in development. The config files are different, so I am really just trying to figure out what module/directive it is that tells Apache to unzip files with the extension .gz before returning them to the client.

Can anyone point me in the right direction?

(BTW, yes, we're using mod_deflate to gzip files on the fly, so this is kind of redundant to zip the sitemap files. It's just a nice thing to have for testing).

jdMorgan

7:37 pm on Nov 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The server does not unzip the file -- that would defeat the whole purpose/advantage of sending a compressed file across the network.

Use the "Live HTTP Headers" extension for FireFox to examine the server response. The most likely cause of this problem is that your .gz files have not been defined as being of MIME-type "application/x-gzip" with an
AddType application/x-gzip .gz
directive.

Jim

sublime1

5:54 pm on Nov 2, 2006 (gmt 0)

10+ Year Member



Jim --

Thanks for the response. The httpd.conf has an explicit AddType as you noted; same in the old and new versions of Apache (with corresponding old and new conf files).

I checked the headers; old sees the .gz content as the text/xml file that is contained within, new still sees it as .gz. There are a number of directives for controlling types in the mime module, and in mime magic. I probably have something screwed up, but cannot figure out what.

Any other ideas?

jdMorgan

7:22 pm on Nov 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try checking the headers of the WebmasterWorld home page -- The MIME-type response header from the server is "gzip", not .gz.

That's all I can suggest, as solving gzip-specific problems is really not my forte.

Jim