Wednesday, 28 October 2015

How to fix mod_fcgid: read data timeout in 40 seconds error in cPanel

I was getting the below errors in one of my cPanel servers:

[Wed Aug 26 17:33:54 2015] [warn] [client 111.222.33.456] mod_fcgid: read data timeout in 40 seconds
[Wed Aug 26 17:33:54 2015] [error] [client 111.222.33.456] Premature end of script headers: update.php

To fix this error, we can follow the below steps:

Monday, 26 October 2015

Install HHVM in Ubuntu Linux Server for high performance PHP applications and high performance wordpress websites

HHVM (HipHop Virtual Machine) is an open-source virtual machine designed for executing programs written in Hack and PHP developed at Facebook. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development flexibility that PHP provides.

HHVM runs much of the world’s existing PHP. Developers and hosts are adopting HHVM. It can run the top 20 Github PHP frameworks out of the box. The HHVM team, along with many wonderful community members, has made it a stated, high priority goal to run all existing PHP code existing out in the wild.

Friday, 23 October 2015

How to set up a CentOS 7 server (systemd) with basic services installed

Here is the step by step guide to install and configure CentOS 7 server which uses SystemD for the service management. So the commands are slightly different from what we are used:

Tuesday, 20 October 2015

Saturday, 17 October 2015

Install and configure Monit for automated monitoring, alerting and restarting of services in Linux

Monit is a utility for managing and monitoring processes, programs, files, directories and filesystems on a Unix system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. E.g. Monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses too much resources. You can use Monit to monitor files, directories and filesystems for changes, such as timestamps changes, checksum changes or size changes.

Monit is controlled via an easy to configure control file based on a free-format, token-oriented syntax. Monit logs to syslog or to its own log file and notifies you about error conditions via customisable alert messages. Monit can perform various TCP/IP network checks, protocol checks and can utilise SSL for such checks. Monit provides a HTTP(S) interface and you may use a browser to access the Monit program.

Friday, 16 October 2015

How to force HTML to run as PHP

We can use Apache Handlers to force HTML pages to execute as PHP scripts.

So to do this. add the below line to .htaccess file:

AddHandler application/x-httpd-php5 .html .htm


Thursday, 15 October 2015

Set up a server using Webmin Control Panel

We will be using below steps to set up a server using Webmin Control Panel and Ubuntu.

Operating System : Ubuntu 14.04 LTS
Control Panel : Webmin
Database : MySQL Server 5.6
Web Server : Apache web server
Database Management : PhpMyAdmin
DNS : BIND Name Server
FTP : ProFTP server