Mod_gzip is an external extension module for Apache Web server. However, it’s worth noting that mod_gzip has been deprecated and replaced by mod\_deflate in Apache 2.4 and later.
If you’re using Apache 2.4 or later, you should use mod_deflate instead of mod_gzip. Here is how to enable mod\_deflate:
1. Firstly, you need to make sure the deflate module is installed. Run this command in the terminal:
```
a2enmod deflate
```
1. Then, you need to add some lines to `httpd.conf` (usually found in /etc/apache2/ or /etc/httpd/) to tell apache to deflate files:
```
```
1. Restart your apache service by executing:
For Ubuntu/Debian systems:
\`\`\` sudo service apache2 restart \`\`\`For CentOS/RedHat systems:
\`\`\` sudo service httpd restart \`\`\`If you still want to use mod\_gzip on your Apache server below version 2.4, here’s how to do it:
1. Download and unpack the mod\_gzip file from a trusted source.
2. Go to Apache’s source directory, and then `./configure`, add `—with-module=gzip_module:PATH-TO-MOD_GZIP`.
```
./configure —with-module=gzip_module:/home/user/mod_gzip
```
1. Execute `make` and `make install`.
2. Open `httpd.conf` and add this line:
```
LoadModule gzip_module modules/mod_gzip.so
```
1. Depending on your configuration, you may also want to add the following lines:
```
mod_gzip_on yes
mod_gzip_can_negotiate yes
mod_gzip_static_suffix .gz
AddEncoding gzip .gz
mod_gzip_update_static no
```
1. Restart Apache service.
Please make sure to replace “PATH-TO-MOD_GZIP” with the path to where you’ve downloaded the mod_gzip files.