Question

DeflateCompressionLevel and other directives just don't work in Ubuntu 14.04

I have looked at the mod_deflate tutorial and tried to reduce the compression level as instructed midway through that tutorial.

But, no matter where I place the compression level or other directives, apachectl configtest fails with the following error:

root@host:/etc/apache2/mods-enabled# apachectl configtest
AH00526: Syntax error on line 21 of /etc/apache2/mods-enabled/deflate.conf:
Invalid command '\xe2\x80\x8bDeflateMemLevel', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

Here’s how my deflate.conf looks in Ubuntu 14.04 and the three directives there are what I am trying to add:

<IfModule mod_deflate.c>
        <IfModule mod_filter.c>
                # these are known to be safe with MSIE 6
                AddOutputFilterByType DEFLATE text/html text/plain text/xml

                # everything else may cause problems with MSIE 6
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/xml
         </IfModule>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Here are the values I am trying to add to the file:

DeflateCompressionLevel 7
​DeflateMemLevel 8
​DeflateWindowSize 10

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi @cloudnine

From the error Invalid command '\xe2\x80\x8bDeflateMemLevel' it looks like the file contains UTF-8 characters, which I don’t think is supported. Try creating a clean ASCII encoded file.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.