Install REDIS with Plesk Onyx

This is a quick guide on how to install both the Redis PHP extension as well as the daemon via SSH on a Plesk Onyx webserver.

REDIS provides memory caching for frequently accessed objects.

 

How to install the plugin:

Log in to the command line via SSH as the ROOT user and run the following commands line-by-line.

CentOS

yum groupinstall 'Development Tools'
yum install tcl wget

Debian and Ubuntu

apt-get install build-essential
apt-get install tcl wget

Download and Compile latest Redis 4:

wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable/
make distclean
make
make test
make install

Install your Redis-server Service:

cd utils/
./install_server.sh

Allow memory overcommit

This will allow REDIS to use more memory than it has been allocated by Plesk if required.

echo "vm.overcommit_memory = 1" >>  /etc/sysctl.conf  && sysctl  -p

Disable transparant_hugepage

echo never > /sys/kernel/mm/transparent_hugepage/enabled

Start and test your Redis service

This will ensure REDIS starts when your server boots and checks to ensure the installation completed successfully.

systemctl start redis_6379
systemctl status redis_6379

Install mcrypt and PHP upgrade to 5.3.3

On CENTOS5 upgrade php to 5.3.3 and installed mcrypt for the use of Magento.
Here are the commands to install it all

sudo yum update

upgrade PHP 5.3:

php -v

list command to quickly get information:

yum list installed | grep php | cut -d' ' -f1

checked to make sure that those packages were available for php53:

yum search php53 | cut -d' ' -f1 | grep php

Stop webserver

sudo service httpd stop

remove the old PHP packages:

sudo yum remove php php-cli php-common php-devel php-gd php-mbstring \
 php-mysql php-mcrypt php-pdo php-pear php-pgsql php-xml php-xmlrpc
 

Installed the available replacement packages:

sudo yum install php53 php53-cli php53-common php53-devel php53-gd \
 php53-mbstring php53-mysql php53-pdo php53-pgsql php53-xml php53-xmlrpc
 

Install PHP mcrypt

 sudo yum install php53-devel libmcrypt-devel
 
 wget http://museum.php.net/php5/php-5.3.3.tar.gz
 
 tar xf php-5.3.3.tar.gz
 
 cd php-5.3.3/ext/mcrypt/
 
 phpize
 
 aclocal
 
 ./configure
 
 make
 
 make test
 
 sudo make install
 

Now all we have to do is set up the mcrypt.ini file so that the mcrypt extension loads with PHP. This file needs to reside at /etc/php.d/mcrypt.ini.

 echo -e "; Enable mcrypt extension module\nextension=mcrypt.so" | \
 sudo tee /etc/php.d/mcrypt.ini
 

Install PHP Pear

wget http://pear.php.net/go-pear.phar
sudo php go-pear.phar 
sudo service httpd start

Problems:

configure.in:8: warning: LT_AC_PROG_SED is m4_require’d but is not m4_defun’d
configure.in:8: LT_AC_PROG_SED is required by…
acinclude.m4:2683: PHP_CONFIG_NICE is expanded from…
configure.in:8: the top level

Files ltmain.sh & libtool.m4 missing from /usr/share/alocal

Find the files of the server

$ find / -name ltmain.sh

result: /usr/lib/php/build/ltmain.sh

$ find / – name libtool.m4

result: /usr/lib/php/build/libtool.m4

Navigate to the alocal

cd /usr/share/alocal

Create symlinks for the found files

ln -s /usr/lib/php/build/ltmain.sh ltmain.sh
ln -s /usr/lib/php/build/libtool.m4 libtool.m4

all done

Resume process with alocal command