title: Cannot enable Gzip compression in Apache (FreeBSD)
body: <p>I have problem with Gzip compression on Apache server (FreeBSD). In my httpd.conf file I have:</p>
  <pre><code>ServerRoot &quot;/home/xxxx-strona&quot;
  Listen 10.0.1.240:55734
  PidFile /home/xxxx-strona/NOBACKUP/pid
  Mutex default:/home/xxxx-strona/NOBACKUP
  StartServers 1
  MinSpareServers 1
  MaxSpareServers 1
  LoadModule mpm_prefork_module /usr/local/libexec/apache24/mod_mpm_prefork.so
  LoadModule authn_core_module /usr/local/libexec/apache24/mod_authn_core.so
  LoadModule authz_core_module /usr/local/libexec/apache24/mod_authz_core.so
  LoadModule unixd_module /usr/local/libexec/apache24/mod_unixd.so
  LoadModule reqtimeout_module /usr/local/libexec/apache24/mod_reqtimeout.so
  LoadModule log_config_module /usr/local/libexec/apache24/mod_log_config.so
  LoadModule setenvif_module /usr/local/libexec/apache24/mod_setenvif.so
  LoadModule dir_module /usr/local/libexec/apache24/mod_dir.so
  LoadModule mime_module /usr/local/libexec/apache24/mod_mime.so
  LoadModule alias_module /usr/local/libexec/apache24/mod_alias.so
  LoadModule rewrite_module /usr/local/libexec/apache24/mod_rewrite.so
  LoadModule expires_module /usr/local/libexec/apache24/mod_expires.so
  LoadModule headers_module /usr/local/libexec/apache24/mod_headers.so
  LoadModule filter_module /usr/local/libexec/apache24/mod_filter.so
  LoadModule deflate_module /usr/local/libexec/apache24/mod_deflate.so
  LoadModule php7_module /usr/local/libexec/apache24/libphp7.so
  LoadModule php7_module /usr/local/libexec/apache24/mod_http2.so
  
  ServerAdmin xxxx
  ServerName www.xxxx.pl
  DocumentRoot &quot;strona&quot;
  &lt;IfModule dir_module&gt;
      DirectoryIndex index.html index.php index.php3 index.cgi
  &lt;/IfModule&gt;
  &lt;Directory /&gt;
   AllowOverride All
  &lt;/Directory&gt;
  &lt;FilesMatch &quot;^\.ht&quot;&gt;
  Require all denied
  &lt;/FilesMatch&gt;
  #ErrorLog &quot;NOBACKUP/httpd-error.log&quot;
  ErrorLog &quot;/dev/null&quot;
  LogLevel warn
  
  &lt;IfModule log_config_module&gt;
      LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
  #    CustomLog &quot;apache/httpd-access.log&quot; combined
   CustomLog &quot;/dev/null&quot; combined
  &lt;/IfModule&gt;
  
  &lt;IfModule mime_module&gt;
      TypesConfig /usr/local/etc/apache24/mime.types
      AddType application/x-compress .Z
      AddType application/x-gzip .gz .tgz
      AddHandler cgi-script .cgi .pl
      AddType application/x-httpd-php .php .php4 .php3
      AddType application/x-httpd-php-source .phps
  &lt;/IfModule&gt;
  EnableSendfile off
  
  &lt;IfModule mod_deflate.c&gt;
      &lt;IfModule mod_filter.c&gt;
          # 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
          AddOutputFilterByType DEFLATE image/svg+xml
      &lt;/IfModule&gt;
  &lt;/IfModule&gt;
  
  &lt;Directory /home/xxxx/xxxx-strona2/strona/&gt;
  php_admin_value upload_tmp_dir /home/xxxx-strona/NOBACKUP
  &lt;/Directory&gt;
  </code></pre>
  <p>but I still getting error:</p>
  <blockquote>
  <p>We successfully added Gzip compression settings into .htaccess file.
  However, the test file we fetched was not Gzip-compressed. It seems
  one of Apache modules - mod_filter or mod_deflate - is not active.</p>
  </blockquote>
  <p>(WP Optimize plugin)</p>
  <p>GTmetrix also says that Gzip is not enabled.</p>
  <p>Where is mistake?</p>