Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running CentOS 5.6 with cPanel.

I've rebuilt my apache to have deflate enabled. Here is my EasyApache Build Log:



...checking whether to enable mod_deflate... yes (default)

Within my http.conf there is no LoadModule mod_deflate, and there is no mod_deflate.so within my Modules/ Directory.

What am I doing wrong?


Ok, So I ran this command and it returned this:

/usr/local/apache/bin/httpd -M Loaded Modules: core_module (static) authn_file_module (static) authn_default_module (static) authz_host_module (static) authz_groupfile_module (static) authz_user_module (static) authz_default_module (static) auth_basic_module (static) include_module (static) filter_module (static) deflate_module (static) log_config_module (static) logio_module (static) env_module (static) expires_module (static) headers_module (static) unique_id_module (static) setenvif_module (static) version_module (static) proxy_module (static) proxy_connect_module (static) proxy_ftp_module (static) proxy_http_module (static) proxy_scgi_module (static) proxy_ajp_module (static) proxy_balancer_module (static) ssl_module (static) mpm_prefork_module (static) http_module (static) mime_module (static) status_module (static) autoindex_module (static) asis_module (static) info_module (static) suexec_module (static) cgi_module (static) negotiation_module (static) dir_module (static) actions_module (static) userdir_module (static) alias_module (static) rewrite_module (static) so_module (static) bwlimited_module (shared) security2_module (shared) Syntax OK

Which Suggests that deflate is running.

I added this to my httpd.conf with no luck.

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript    application/javascript  application/xml

What needs to be added to get Deflate to work??

share|improve this question
no expert but didnt you just compile mod_deflate directly into apache so therefor its always on. –  Silverfire Aug 17 '11 at 2:04
Under Software / Services, did you see an icon called Optimize Website? –  quanta Aug 17 '11 at 2:10
No, I do not see Optimize Website in cPanel/WHM anywhere –  Moe Aug 17 '11 at 2:20
..and yes, it does turn out that mod_deflate is always on, but I cannot get it to work. –  Moe Aug 17 '11 at 3:01

2 Answers 2

up vote 0 down vote accepted

How are you determining that compression is ~not~ working?

Not 100% sure on this one, but I think you need to load the module in your conf, by compiling it in you are just compiling ~support~ for the module...

Try this:

# explicitly load the module
LoadModule deflate_module modules/mod_deflate.so

# Deflate output configuration
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript

# take care of silly browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html


share|improve this answer
I get this error:httpd: Syntax error on line 32 of /usr/local/apache/conf/httpd.conf: module deflate_module is built-in and can't be loaded –  Moe Aug 17 '11 at 2:55
I didn't need to load the module, but the rest worked a treat. Thanks. –  Moe Aug 17 '11 at 3:09
glad I could help –  Sean Kimball Aug 17 '11 at 13:15

I think you want to add --enable-so to your configure options.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.