Wednesday, November 18, 2015

Debian 8 and Varnish 4 Problem

The Varnish service was starting OK but it wasn't using any of the parameters, set in /etc/default/varnish.

For example, set the listening port to be 80, but Varnish would always start with port 6081.

The Varnish service (/lib/systemd/system/varnish.service) wasn't using any parameter files - instead it was hard coded to start with the default values only.

The temporary fix is to edit the varnish.service file and manually configure the parameters to match your needs.


Thursday, November 12, 2015

Disable MySQL Strict mode in Debian 8 permanently

All blogs say:

 for turning off strict mode you must add following line to /etc/mysql/my.cnf:


and restart the mysql server.

That was not working me.

I have found another setting file for mysql: /usr/my.cnf

and in this file exists sql_mode parameter too.


this line must be commented out too:


Don't forget to restart the mysql server.

Thursday, July 23, 2015

Checking SSL Certifcate on Plesk Mail Server

Run this command ( is the MX-Record):

openssl s_client -starttls smtp -crlf -connect

openssl s_client -starttls pop3 -crlf -connect

openssl s_client -starttls imap -crlf -connect

As result you can see your certificate if it installed correctly:

Certificate chain
0 s:/description=FmJdZEx3lsXPoIXv/C=DE/
   i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA
1 s:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA
   i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority

How to downgrade Openssl on CentOS?

List the available versions by running this command:

yum --showduplicates list openssl

you should see these lines:

Installed package:

Available packages:
openssl.x86_64 - 1:1.0.1e-42.el7 - base
openssl.x86_64 - 1:1.0.1e-42.el7_1.5 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.4 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.6 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.8 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.9 - updates

then doing:

yum downgrade openssl-1.0.1e-42.el7_1.5

it will downgrade openssl to 7_1.5 version.

Friday, March 27, 2015

Rollback to previous package version after bad upgrade with Debian

This will show all the versions of the package in the cache:
apt-cache show [package name]

This will install an older version of the package
apt-get install [package name]=[version]

Tuesday, November 11, 2014

RSYNC using filter to include some files

use rsync with Filter option to include some files.

For example:

rsync -auvz -f'+ [Aa][Mm]*'  -f'+ */' -f'- *' /SOURCE-Folder/ /TARGET-Folder/

It means: exclude all files and include only files beginning with A and M (insensitive).

Wednesday, November 5, 2014

Add line to the beginning of a file in Bash

To add a line to the beginning of a file, use this command: 
sed -i '1s/^/YOUR NEW LINE\n/' YOUR-FILE.TXT