httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bo Berglund <>
Subject [users@httpd] Re: How to configure Apache 2 to compress xml files on serving?
Date Sat, 14 Jun 2008 06:28:57 GMT
On Fri, 13 Jun 2008 23:53:13 +0100, Nick Kew <>

>On Fri, 13 Jun 2008 19:17:32 +0200
>Bo Berglund <> wrote:
>> I need to set up a test environment where I am running Apache locally
>> with a number of xml data files as objects to serve.
>> I am doing this to simulate a live server tha I don't want to disturb
>> for my testing. The live server responds to requests for file URL:s
>> like: http://server/dir/file.xml.gz by sending a gzipped data stream
>> that FireFox discovers is compressed and expands it into the browse
>> window so that the file.xml contents is shown.
>The above is hopelessly at odds with your configuration:
Well, I only use Apache to test stuff, I have no idea how it works and
the entries in httpd.conf are copies of other entries that seem to
work. That's basically why I ask...

>> <Directory "C:/Engineering/Projects/XMLTV/Testsite">
>>     Options Indexes MultiViews Includes
>>     AllowOverride None
>>     Order allow,deny
>>     Allow from all
>>     AddType text/html .shtml
>>     AddType application/x-httpd-php .php
>That's been wrong since 1996.  Use AddHandler.

How do I specifically use "AddHandler"?
Do you have a working example?

>>     AddOutputFilter INCLUDES .shtml 
>That won't work on a compressed file unless you decompress
>it (with mod_deflate) first.

I never said that would work for gz files, it is a *copy* of the
settings I use for another test site where SSI is used and shtml files
are the majority of the files...
Again, I don't know how Apache works, I just copied the settings from
one directory to enable a test site from another directory.

I tried to find some info on AddOutputFilter but the docs only state
that one can use these to process the data before they are sent to the
client (which is what I want) but I could not find any *list* of valid
( I
found this:
For example, the following configuration will process all .shtml files
for server-side includes and will then compress the output using

AddOutputFilter INCLUDES;DEFLATE shtml

If I wanted to "filter" xml files so they are compressed using gzip,
how should the filter then be set up???

>Neither will any of the above do anything to a file.xml.gz.
>If you don't already have them, you probably want
>	AddType text/xml .xml
>(or other XML type)
>	AddEncoding gzip .gz
>> </Directory>

After reading some other posts I have this in my conf (still not
working though):

<Directory "C:/Engineering/Projects/XMLTV/XMLTVTestsite">
    Options Indexes MultiViews Includes
    AllowOverride None
    Order allow,deny
    Allow from all
    AddEncoding x-gzip .gz
    AddType text/xml .xml.gz
    AddType text/html .shtml

Bo Berglund

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message