# Performing post-installation activities

Enabling GZIP compression

Gzip compression is a part of post installation.

## Enabling GZip compression in Tomcat

* Navigate to {{tomcat-home}}*/conf/server.xml* file and add the following lines to the HTTP Connector configuration.

```
compression="on" useSendfile="false" 
compressableMimeType="text/css,text/javascript,application/javascript"
```

* For example, an HTTP Connector configuration with compression  enabled is described as follows:

```
<Connector port="8080" maxHttpHeaderSize="8192"maxThreads="150" minSpareThreads="25" maxSpareThreads="75"enableLookups="false" redirectPort="8443" acceptCount="100"connectionTimeout="20000" disableUploadTimeout="true"compression="on" compressionMinSize="8192"

userSendfile="false" compressableMimeType="text/css,text/javascript,application/javascript"/>
```

## Enabling GZip compression in Apache (Worker Environment)

1. Ensure that the following modules are available in&#x20;   {{apache-home}}/modules/\*
   1. mod\_deflate.so&#x20;
   2. mod\_mime\_magic.so
   3. mod\_headers.so
   4. mod\_mime.so
   5. mod\_setenvif.so
2. Add the following to {{apache-home}}*/conf/httpd.conf or cloudio.conf* depending on your configuration:

```
LoadModule deflate_module modules/mod_deflate.so
<IfModule mime_module>
AddType application/javascript .js
AddType text/css .css
</IfModule>
<IfModule deflate_module>
AddOutputFilterByType DEFLATE text/css text/html text/plain text/xml application/javascript
<IfModule mod_setenvif.c>
 BrowserMatch ^Mozilla/4 gzip-only-text/html
 BrowserMatch ^Mozilla/4\.0[678] no-gzip
 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
 Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>
```

{% hint style="info" %}
If compression is enabled in Apache, then compression in Tomcat is not required.
{% endhint %}
