Wednesday 20 November 2013

Enable Mod deflate in plesk servers (10.x,11.x)

 
In the latest plesk 10.x and 11.x there is an option to add Apache modules from GUI
under "Tools&Settings >> Apache Modules". It just needs selection and saving to 
enable Apache modules from the Plesk panel.

Once the module is enabled. We will have to make sure that it is loaded in the
configuration file by using the following command. 

-----------------------------------------------
grep 'mod_deflate' /etc/httpd/conf/httpd.conf
----------------------------------------------- 

if it is not loaded we will have to edit the http configuration file to enable it 
with the following command
 
------------------------------------------------------------------------------------- 
perl -pi -e 's/# LoadModule mod_deflate/LoadModule mod_deflate/g' /etc/httpd/conf/httpd.conf 
-------------------------------------------------------------------------------------
 
In normal cases it will be enabled. Once this is done it is a good ideas to back up the configuration file.  
 
--------------------------------------------------------------- 
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak 
---------------------------------------------------------------

Once the backup is done we will have to add up the following lines in httpd.conf using text editors like vi.

vi /etc/httpd/conf/httpd.conf
and add the following lines at the end of the configuration file.
---------------------------------------------------------------------------------
 #
 # Deflate output configuration
 #
 AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
 BrowserMatch ^Mozilla/4 gzip-only-text/html
 BrowserMatch ^Mozilla/4\.0[678] no-gzip
 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
--------------------------------------------------------------------------------- 
 
Please check the syntax is correct once editing the apache conf by using the following
command
------------------------ 
/usr/sbin/apachectl -t
------------------------
 
Please restart the Apache process for the configuration changes to take place.
 
----------------------------  
/usr/sbin/apachectl graceful  
----------------------------
 
 
Learn & Share.
rzm 

No comments:

Post a Comment