You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Willingham, Shaun" <us...@plc.mb.ca> on 2004/12/14 05:48:46 UTC

[users@httpd] Problem with mod_deflate

Hi all,

I have an issue with mod_deflate, running on Apache 2.0.52.

Until today, I'd been running 2.0.48 with php/mysql no problem. One of the
users on my discussion forum pointed out that zip files were corrupted,
when they attempted to download from my server.

I isolated the problem to mod_deflate. Apparently compressed binaries
don't like being compressed a second time. Alright, makes sense - I
thought I'd just add a filter to my httpd.conf to not compress .zip, .exe,
.pdf, etc. This didn't work.

I upgraded to Apache 2.0.52 and updated the zlib lib to 1.2.1. Now when I
run apache while loading mod_deflate, I get this error:

Syntax error on line 266 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/modules/mod_deflate.so into server:
/usr/local/apache/modules/mod_deflate.so: undefined symbol: deflate

I haven't changed anything. It was working fine before. I figured apache
couldn't find zlib, so I specified where it was at compile time.

Here's the vital info...

My apache configuration directive:

./configure --prefix=/usr/local/apache --enable-module=so --enable-modules=all 
--enable-mods-shared=all --enable-deflate --with-zlib=/usr/local/zlib

Here's part of my httpd.conf where mod_deflate is loaded: (I won't post the 
whole thing..)

LoadModule deflate_module      modules/mod_deflate.so

--

Apache works fine if I leave the mod_deflate.so commented out, but I need this 
module!

Has anyone else had a similar/identical problem? What did you do to fix it?

I tried downgrading the zlib library, but same results.

S

---------------------------------------------------------------------
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] Problem with mod_deflate

Posted by us...@plc.mb.ca.
> Upgrading zlib won't help, you just need to configure mod_deflate more
> carefully, for instance to only compress text/html content:

It seems the directives I was using (before I had the problems) weren't
effective. I'll review them again once I have an opportunity to play later
today.

I can't even get mod_deflate to work until the undefined symbol issue has
been cleared up. I will attempt to rebuild libz as a shared library.

Thanks again for your thoughtful advice, Joe.

Shaun


---------------------------------------------------------------------
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] Problem with mod_deflate

Posted by Joshua Slive <js...@gmail.com>.
On Wed, 15 Dec 2004 14:48:48 -0600 (CST), usenetx3@plc.mb.ca
<us...@plc.mb.ca> wrote:
> > Give us a *specific* URL.  I'm not going to go hunting through your
> > site for problems.
> 
> http://www.scanmanitoba.com/forum/showthread.php?p=951

I'm getting this:

Connected to www.scanmanitoba.com.
Escape character is '^]'.
GET /forum/attachment.php?attachmentid=66 HTTP/1.1
Host: www.scanmanitoba.com
Accept-Encoding: gzip,deflate

HTTP/1.1 200 OK
Date: Thu, 16 Dec 2004 00:46:33 GMT
Server: Apache/2.0.52 (Unix) DAV/2 PHP/4.3.10RC2
X-Powered-By: PHP/4.3.10RC2
Set-Cookie: bblastvisit=1103158016; expires=Fri, 16-Dec-2005 00:46:56
GMT; path=/
Set-Cookie: bblastactivity=1103157955; expires=Fri, 16-Dec-2005
00:46:56 GMT; path=/
Cache-control: max-age=31536000
Expires: Fri, 16 Dec 2005 00:46:56 GMT
Last-Modified: Wed, 15 Dec 2004 20:47:31 GMT
Content-disposition: inline; filename="i285.zip"
Content-transfer-encoding: binary
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 27086
Content-Type: application/zip

This indeed shows the correct content type and gzip encoding.

What content-type do .php scripts have in httpd.conf?

You should be aware of the limitations of AddFilterByType: see the
docs.  In particular, it acts only on the content type that apache
thinks the file has when it starts the request.  It doesn't act on the
actual content type sent by the php script.

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] Problem with mod_deflate

Posted by us...@plc.mb.ca.
> Give us a *specific* URL.  I'm not going to go hunting through your
> site for problems.

http://www.scanmanitoba.com/forum/showthread.php?p=951


---------------------------------------------------------------------
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] Problem with mod_deflate

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 14 Dec 2004 15:32:53 -0600 (CST), Willingham, Shaun
<us...@plc.mb.ca> wrote:
> On Tue, 14 Dec 2004, Joshua Slive wrote:
> 
> > Let's see the HTTP response headers on an example file.  (Or give us a
> > URL so we can check ourselves).
> 
> http://www.scanmanitoba.com
> 
> The problematic area is http://www.scanmanitoba.com/forum/

Give us a *specific* URL.  I'm not going to go hunting through your
site for problems.

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] Problem with mod_deflate

Posted by "Willingham, Shaun" <us...@plc.mb.ca>.
On Tue, 14 Dec 2004, Joshua Slive wrote:

> Let's see the HTTP response headers on an example file.  (Or give us a
> URL so we can check ourselves).

http://www.scanmanitoba.com

The problematic area is http://www.scanmanitoba.com/forum/


S

---------------------------------------------------------------------
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] Problem with mod_deflate

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 14 Dec 2004 11:58:19 -0600 (CST), usenetx3@plc.mb.ca
<us...@plc.mb.ca> wrote:
> Here's a bit of an update...
> 
> I recompiled zlib as a shared library - this fix the undefined symbols
> issue. I can now run mod_deflate. But!
> 
> mod_deflate doesn't seem to be ignoring the file types I've specified as
> exclusions. I've even tried this basic setup with no success:
> 
> <Location />
> AddOutputFilterByType DEFLATE text/html text/plain text/xml
> </Location>
>   DeflateCompressionLevel 6
> 
> -----
> 
> Does it matter that these file attachments (zip files) are on a php forum?
> Maybe they're encoded in the PHP data or something. I don't know - I'm
> certainly no expert.

Let's see the HTTP response headers on an example file.  (Or give us a
URL so we can check ourselves).

One guess is that you have a configuration problem that is causing
your zip files to be sent as text/plain.

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] Problem with mod_deflate

Posted by us...@plc.mb.ca.
Here's a bit of an update...

I recompiled zlib as a shared library - this fix the undefined symbols
issue. I can now run mod_deflate. But!

mod_deflate doesn't seem to be ignoring the file types I've specified as
exclusions. I've even tried this basic setup with no success:

<Location />
AddOutputFilterByType DEFLATE text/html text/plain text/xml
</Location>
  DeflateCompressionLevel 6


-----

Does it matter that these file attachments (zip files) are on a php forum?
Maybe they're encoded in the PHP data or something. I don't know - I'm
certainly no expert.

If anyone has a suggestion, I'm all ears!

S


---------------------------------------------------------------------
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] Problem with mod_deflate

Posted by Joe Orton <jo...@redhat.com>.
On Mon, Dec 13, 2004 at 10:48:46PM -0600, Willingham, Shaun wrote:
> I isolated the problem to mod_deflate. Apparently compressed binaries
> don't like being compressed a second time. Alright, makes sense - I
> thought I'd just add a filter to my httpd.conf to not compress .zip, .exe,
> .pdf, etc. This didn't work.
> 
> I upgraded to Apache 2.0.52 and updated the zlib lib to 1.2.1. Now when I
> run apache while loading mod_deflate, I get this error:

Upgrading zlib won't help, you just need to configure mod_deflate more
carefully, for instance to only compress text/html content:

http://httpd.apache.org/docs-2.0/mod/mod_deflate.html

> Syntax error on line 266 of /usr/local/apache/conf/httpd.conf:
> Cannot load /usr/local/apache/modules/mod_deflate.so into server:
> /usr/local/apache/modules/mod_deflate.so: undefined symbol: deflate

This is typically a problem when you don't build zlib as a shared
library, e.g. libz.so.

joe


---------------------------------------------------------------------
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