You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Preetam Palwe <pr...@aftek.com> on 2007/11/06 16:50:31 UTC
[users@httpd] RE: Apache + DEFLATE : Does not work
To add one more thing
I tested this with mozilla and firebug from outside my organization (from my
home) and to my surprise it working. I am able to see the reduced size java
script (7K instead of 29K)
But it still not working from inside my organization. Am I behind any proxy?
Thanks Again.
~Preetam
_____
From: Preetam Palwe [mailto:preetamp@aftek.com]
Sent: Tuesday, November 06, 2007 9:04 PM
To: users@httpd.apache.org
Cc: preetam palwe
Subject: Apache + DEFLATE : Does not work
Hello
We have Apache serving our static contents and Jboss to serve the
dynamic data / transactions.
We have changed configuration in Apache so that I can use html/xml/java
script compression using mod_deflate.
But the problem is I am not able to receive compressed contents in browser.
I have verified this in mozilla (2.0.0.9) using Firebug addon.
Can you please help me in this.
Here is the sample configuration
<VirtualHost X.Y.Z.W:80>
ServerAdmin preet
<http://groups.google.com/groups/unlock?msg=1f10ed2e254930c0&_done=/group/co
mp.infosystems.www.servers.unix/browse_thread/thread/966bfbc71df9fc65/1f10ed
2e254930c0> ...@aftek.com
DocumentRoot
"/usr/java/jboss-4.0.3SP1/server/default/deploy/sample.ear/sample.war"
ServerName sample.aftek.com
ErrorLog logs/sample-error_log
TransferLog logs/sample-access_log
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkMount /sample worker1
JkMount /sample/* worker1
JkUnMount /sample/images/* worker1
JkUnMount /sample/css/* worker1
JkUnMount /sample/js/* worker1
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%) "%{User- agent}i"'
deflate
CustomLog logs/deflate_log deflate
<Location /sample>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</Location>
</VirtualHost>
Version Info
Jboss: jboss-4.0.3SP1
Apache: httpd-2.0.52-28
Mod_jk: mod_jk-1.2.15-1
Also
I suspect there is something going wrong in response headers :
"Vary : Accept-Encoding"
Thanks for help in advance.
Thanks & Best Regards
~Preetam
RE: [users@httpd] RE: Apache + DEFLATE : Does not work
Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
I have not had much luck using AddOutputFilterByType either. You would be better off using mod_filter.
Although mod_filter is not in the 2.0 branch, it is possible to compile it for 2.0.
1. Replace ~/src/httpd-2.0.59/include/util_filter.h with util_filter.h from Apache 2.2.x (I used 2.2.4)
2. Copy mod_filter.c to an appropriate directory.
3. Add the following lines to the beginning of mod_filter.c
#define ap_regex_t regex_t
#define AP_REG_NOSUB REG_NOSUB
#define AP_REG_NOMATCH REG_NOMATCH
#define AP_REG_ICASE REG_ICASE
4. Compile
gcc -O2 -c -I . -I ~/src/httpd-2.0.59/include -I ~/src/httpd-2.0.59/srclib/apr/include -I ~/src/httpd-2.0.59/srclib/apr-util/include -I ~/src/httpd-2.0.59/os/unix -o mod_filter.o mod_filter.c
5. Link
ld -G -o mod_filter.so mod_filter.o
6. Copy the library to the appropriate location
cp mod_filter.so /usr/local/apache2/modules
7. Load the module into Apache by adding the following line to httpd.conf:
LoadModule filter_module /usr/local/apache2/modules/mod_filter.so
8. See documentation for relevant configuration directives for mod_filter.
-ascs
________________________________
De : Preetam Palwe [mailto:preetamp@aftek.com]
Envoyé : mardi 6 novembre 2007 16:51
À : users@httpd.apache.org
Objet : [users@httpd] RE: Apache + DEFLATE : Does not work
To add one more thing
I tested this with mozilla and firebug from outside my organization (from my home) and to my surprise it working. I am able to see the reduced size java script (7K instead of 29K)
But it still not working from inside my organization. Am I behind any proxy?
Thanks Again.
~Preetam
________________________________
From: Preetam Palwe [mailto:preetamp@aftek.com]
Sent: Tuesday, November 06, 2007 9:04 PM
To: users@httpd.apache.org
Cc: preetam palwe
Subject: Apache + DEFLATE : Does not work
Hello
We have Apache serving our static contents and Jboss to serve the dynamic data / transactions.
We have changed configuration in Apache so that I can use html/xml/java script compression using mod_deflate.
But the problem is I am not able to receive compressed contents in browser. I have verified this in mozilla (2.0.0.9) using Firebug addon.
Can you please help me in this.
Here is the sample configuration
<VirtualHost X.Y.Z.W:80>
ServerAdmin preet... <http://groups.google.com/groups/unlock?msg=1f10ed2e254930c0&_done=/group/comp.infosystems.www.servers.unix/browse_thread/thread/966bfbc71df9fc65/1f10ed2e254930c0> @aftek.com
DocumentRoot "/usr/java/jboss-4.0.3SP1/server/default/deploy/sample.ear/sample.war"
ServerName sample.aftek.com
ErrorLog logs/sample-error_log
TransferLog logs/sample-access_log
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkMount /sample worker1
JkMount /sample/* worker1
JkUnMount /sample/images/* worker1
JkUnMount /sample/css/* worker1
JkUnMount /sample/js/* worker1
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%) "%{User- agent}i"' deflate
CustomLog logs/deflate_log deflate
<Location /sample>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</Location>
</VirtualHost>
Version Info
Jboss: jboss-4.0.3SP1
Apache: httpd-2.0.52-28
Mod_jk: mod_jk-1.2.15-1
Also
I suspect there is something going wrong in response headers :
"Vary : Accept-Encoding"
Thanks for help in advance.
Thanks & Best Regards
~Preetam
---------------------------------------------------------------------
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