PHP 5.6 CentOS 6

One of the bad things with the default repos on CentOS is that the PHP releases are really dated.
I recently needed a later version of PHP on one of my servers so did some digging to find the following webtatic repo for all the latest PHP and module releases.

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

That will install the yum repository for you so you can do the magical yum installs
The usual and basic modules for PHP 5.6 are as follows;

yum install php56w php56w-mysql php56w-xml
Continue reading

Percona Repo for CentOS 6

I have been wanting to use the Percona MySQL drop-in replacement for a while now. When trying CentOS 7, Percona is already into repos as the replacement for Mysql Server.

Below is the command to add the Percona repos into your yum repos lists.

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm

Then to install Percona 5.7 for example

yum install Percona-Server-server-57 Percona-Server-client-57

As we know, its a drop-in replacement for MySQL so the rest works as before; Don’t forget to optimize and use the mysql_secure_installation to remove the test database and setup root passwords.

NOTE: 57 setups a temporary root password, to find this check the /var/log/mysqld.log file for the following line
2016-02-27T14:49:11.247553Z 1 [Note] A temporary password is generated for root@localhost: rS:+xxxxxx

Crontab; Minutes Hours Day….

“Is it Minutes first or hours first….”

Im forever forgetting which way it goes, i think i have to google it every time i need to edit it.
Minute, Hour, Day of the month, Month, Day of the week, Command
For example if you want to run ntpdate once a day at 1am to update your time

0 1 * * * /usr/sbin/ntpdate uk.pool.ntp.org >/dev/null 2>&1

>/dev/null 2>&1 ???

>/dev/null 2>&1

Pipes all the output  to /dev/null including errors (stderr if i remember right) so you don’t end up with emails without the output of ntpdate.

If your unsure how to view/edit the crontab its really quite easy. Continue reading