Categories

Saturday 8 August 2015

Enable gzip compression on a website in a Linux Server

Hi,

Below are the steps I have followed to enable gzip compression for a site.

1)First enable mod_deflate module for apache on the server

This can be done by using easy apache on the cpanel server. Check if it is enabled or not, by using the command

httpd -l |grep -i deflate


2)Then open the .htaccess configuration file in the website's document root and add the following code on it.


<IfModule mod_mime.c>
 AddType application/x-javascript .js
 AddType text/css .css
</IfModule>
<IfModule mod_deflate.c>
 AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon 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>

3)Also we need to add the gzip compression settings in php.ini of the server


If you are using suphp, then Copy the php.ini to the document root of the wensite

Then add the compression configuration as below
 
output_handler = Off
zlib.output_compression = On
zlib.output_handler = ob_gzhandler
 
 
 
That's it. Now check if gzip is enabled or not using the site

http://checkgzipcompression.com



Saturday 21 March 2015

Steps to Route email through another server in Exim Cpanel

Hi All,

Below is the steps to route the email for all of the domains through another server. The MTA should need to authenticate on to the the relay server inorder to send emails.

On Cpanel Go to

Main > Service Configuration > Exim Configuration Editor, click on the Advanced Editor button, and enter the following in Section:AUTH:
begin authenticators

ServerName_login:
 driver = plaintext
 public_name = LOGIN
 client_send = : ServerNameUsername : ServerNamePassword

on the section client_send provide the mail account username and password to authent
 icate to the antoher server.

Then add the following route in the Section: ROUTERSTART configuration box as shown in the following image:
send_via_ServerName:
driver = manualroute
domains = ! +local_domains
transport = ServerName_smtp
hosts_randomize = true
route_list = * ServerName.com::25 randomize byname
host_find_failed = defer

no_more

Add the following transport to the Section: TRANSPORTSTART configuration box as shown in the following image:
ServerName_smtp:
driver = smtp
hosts_require_auth = *
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}
That's it

Now you will be able to send emails in exim accounts through another server.

Thanks and Regards
Syamkumar.M

Sunday 8 March 2015

Ubuntu dependency issue while upgrading (linux-headers-generic (= 3.2.0.72.86) but 3.2.0.76.90 is to be installed)

Hi,

I faced an error while I ran the apt-get upgrade command on the Ubuntu 12.04 LTS server for fixing the Glibc vulnerability. The Exact error is


linux-header: depends on linux-headers-generic (= 3.2.0.72.86): but 3.2.0.76.90 is to be installed.


Below is the steps for fixing the issue. First check the header packages installed using the command

apt-get --get-selections |grep -i header


Then remove the below packages using the dpkg commands as below.


sudo dpkg -r linux-image-generic-pae
sudo dpkg -r linux-headers-generic-pae
sudo dpkg -r linux-generic-pae


Now run the below commands to upgrade


sudo apt-get -f install
sudo apt-get upgrade


This will installl the required packages and will replace the headers with new one and will resolve the dependency issues.



Thanks and Regards
Syamkumar.M

Tuesday 17 February 2015

sasl login authentication failed authentication failure postfix webmin

Hi,

I faced one of the strange issue in which postfix was unable to send email from the domain users. There was a php mailer script that is sending emails by providing the smtp details(username, password and hostname of smtp server) to the phpmailer configuration file. But unfortunately the authentication was not working and so emails are not going from the code. Below is the steps to fix the issue.

1)First Check the log /var/log/maillog. I found the error as


postfix/smtpd[13573]: warning: localhost[127.0.0.1]: SASL LOGIN authentication failed: authentication failure


2)The postfix is using the saslauth authentication method. Theconfiguration options for starting saslauth with postfix is configured on the file

/etc/sysconfig/saslauthd

Open the configuration file and in the option field there will be a variable "r" is given

OPTIONS="-r"
Remove that option and set it as OPTIONS=""
 
There is no need for r in that .Below is the description for r.
 
 
 -r      Combine the realm with the login (with an '@' sign in between).
             e.g.  login: "foo" realm: "bar" will get passed as login:
             "foo@bar".  Note that the realm will still be passed, which may
             lead to unexpected behavior. 






Thanks and Regards

Syamkumar.M


Ad