How to: Set PHP.INI Timezone

sshYour new Plesk 12 Dedicated Server will need to have the PHP.INI Timezone set for both PHP and Roundcube.

You need to edit:

nano /etc/php.ini
nano /etc/psa-webmail/roundcube/php.ini

Enter/update the timezone information as below:

date.timezone = Europe/London

Use the correct region for your location.

Network Adapter Driver for 82575/6, 82580, I350, and I210/211-Based Gigabit Network Connections for Linux Packet Loss

intel-proset-network-adapter-driver-se-1372665375Fix Packet Loss Issues with IGB Driver

igb-x.x.x.tag.gz is designed to work with Intel® 82575/6, 82580, I350, and I210/211-based adapters/connections under Linux*. The latest version and earlier versions of this driver are available from SourceForge.

Version 5.0.5k is buggy and will result in serious packet loss. Find which driver version you are using.

# ethtool -i eth1

driver: igb
version: 5.0.5-k
firmware-version: 1.52, 0x800007ae
bus-info: 0000:01:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

If you see a version below 5.2.15 then upgrade immediately.

How to redirect HTTP traffic to HTTPS using an .htaccess file

Redirecting HTTP to HTTPS using .htaccess

So you have installed your SSL Certificate and now you want to use it. Paste the following code to the beginning of your .htaccess file to redirect all non-https to https.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

How to: Upgrade PHP and MySQL

sshYour new Centox 6.x server running Plesk 12 will need to have PHP and MySQL upgraded before going in to production.

You can do this using the Atomicorp repositories.

Check the current PHP version

php -v

Download the Atomicorp repository and keys:

wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh

Use yum to upgrade PHP and MySQL

yum upgrade php mysql

Add the most commonly used PHP modules as required

yum install php-ioncube-loader php-mcrypt php-bcmath php-zend-guard-loader db4-utils

Restart the apache/httpd service gracefully…

service httpd graceful

…and test your PHP version.

php -v

Your PHP and MySQL upgrade is now complete.

How to: Set error_reporting in PHP.INI properly

sshYour new Centos 6.x server will quickly build up logs and the php.ini log is one that can get huge. If you only want to see real errors then you need no more than the following setting in your php.ini.

Edit your current PHP.INI

nano /etc/php.ini

Replace the error_reporting setting as follows

error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR

In the even that you require a less strict log level, you can change the entry when required, debug your session then promptly change it back.