Install and configure custom PHP FastCGI version with Plesk 12

If you need to use modern version of PHP and you have Plesk control panel version 12+ you can use php_handler utility.

To view list of currently installed PHP versions use command:

# /usr/local/psa/bin/php_handler --list
             id:  display name:  full version:  version:    type:                           cgi-bin:  php-cli:                           php.ini:  custom:
          module          5.3.3          5.3.3       5.3   module                   /usr/bin/php-cgi                                 /etc/php.ini    false
         fastcgi          5.3.3          5.3.3       5.3  fastcgi                   /usr/bin/php-cgi                                 /etc/php.ini    false
             cgi          5.3.3          5.3.3       5.3      cgi                   /usr/bin/php-cgi                                 /etc/php.ini    false

To install custom PHP build installed to folder /opt/php-5.4.37 use command:

# /usr/local/psa/bin/php_handler --add -displayname php-5.4.37 -path /opt/php-5.4.37/bin/php-cgi -phpini /opt/php-5.4.37/etc/php.ini -type fastcgi -id php-5.4.37

You will see message:

The new PHP handler with the id "php-5.4.37" was successfully registered.

Now, you can select it in Plesk control panel then editing your domain “Hosting settings”.

Mtop utility installation on Debian 7

Mtop utility can be downloaded from http://sourceforge.net/projects/mtop/?source=typ_redirect.
Current version at this moment is: 0.6.6.

To install it the following system packages should be installed as dependencies: libncurses5-dev

# sudo apt-get install libncurses5-dev

Because of error during installation of depended Curses Perl library:
fatal error: ncurses.h: No such file or directory

The following Perl libraries required by mtop should be installed: Curses, Getopt::Long, Net::Domain, DBI and DBD::mysql
I’m istalling them using Perl CPAN module:

# perl -MCPAN -e shell
# ...
cpan[1]> install Curses
cpan[2]> install Getopt::Long
cpan[3]> install Net::Domain
cpan[4]> install DBI
cpan[5]> install DBD::mysql
cpan[6]> quit

Mtop installation process:

# cd /root/install
# tar xzf mtop-0.6.6.tar.gz
# chown -Rf root:root /root/install/mtop-0.6.6/
# cd /root/install/mtop-0.6.6/
# perl Makefile.PL
...
# make
...
# make install
Manifying 2 pod documents
Installing /usr/local/bin/mtop
Installing /usr/local/bin/mkill
Installing /usr/local/bin/mtop
Installing /usr/local/bin/mkill
Installing /usr/local/share/perl/5.14/cpan2spec.pl
Installing /usr/local/share/man/man1/mkill.1p
Installing /usr/local/share/man/man1/mtop.1p
Appending installation info to /usr/local//lib/perl/5.14/perllocal.pod

Now, mtop and mkill utilites are ready for use.

usermod – add a existing user to existing group

If you need to add existing user to existing group use usermod command.

1. Check current user groups using id command:

# id serveradmin
uid=10001(serveradmin) gid=10001(serveradmin) groups=10001(serveradmin)

2. Add existing user to group using usermod command:

# usermod -a -G wheel serveradmin

3. Check if user has been added to group using id command:

# id serveradmin
uid=10001(serveradmin) gid=10001(serveradmin) groups=10001(serveradmin),11(wheel)

SSH login without password using keys

To set up SSH login without passwords using keys:
1. Generate key using ssh-keygen utility. Keys will be saved in this example in ~/.ssh/ folder. File ~/.ssh/id_rsa is your private key. File ~/.ssh/id_rsa.pub is your public key.
2. Add public key to ~/.ssh/authorized_keys on server where you want to login without password using command:

# ssh-copy-id -i ~/.ssh/id_rsa.pub user@shkodenko.com

3. Now you can login as user to example host shkodenko.com without password using your public key using command:

# ssh user@shkodenko.com

OpenSSL check if SSLv3 is disabled

OpenSSL

To verify if OpenSSL protocol version 3 is disabled you can run command:

# openssl s_client -connect  www.shkodenko.com:443 -ssl3

If you will see answer like below:
CONNECTED144:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1257:SSL alert number 40
139824221411144:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:596:

When SSL3 is disabled.

CentOs 6.5 bind 9 hide version

To hide real bind 9 version add directive to /etc/named.conf configuration file.

Inside options { }; block add version directive:
version “BIND custom version”;

To check bind version using dig utility:

# dig chaos txt version.bind @NS_Server_IP

where NS_Server_IP your name server IP or host name