Installing LCMP stack on CentOS 5.5

LCMP Stack LCMP is an acronym for a stack of free, open source software from the first letters of Linux (operating system), Cherokee HTTP Server, MySQL and Perl/PHP/Python. These are the principal components to build a viable general purpose web server.

LCMP – Linux.Cherokee.MySQL.PHP/Perl/Python

In this tutorial we will be installing the following open source software components to build the LCMP stack. CentOS 5.5 (operating system), Cherokee 1.0.6 (web server), MySQL 5.0.77 (database server), PHP 5.3.3, Perl 5.8.8, Python 2.4.3

Before we start just some general house keeping. The base CentOS 5.5 server hostname and IP address in this tutorial:

  • centos01.how2centos.com (IP 10.0.0.3)

The assumption, for this CentOS 5.5 LCMP tutorial, is that you are running as root and have a medium understanding of the software required.

# yum install yum-priorities

Download and install the relevant YUM install repositories

# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-8.ius.el5.noarch.rpm

Install Cherokee web server and RRDtool (allows for graphs on the vhosts)

# yum install cherokee
# yum install rrdtool

Install MySQL server

# yum install mysql mysql-server

Finally install PHP, Perl and Python.

Note: If you upgrading make sure you remove your previous version of PHP

# yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-pecl-memcache php53u-snmp
# yum update perl python

Make sure everything that needs to be started at boot is on

# chkconfig cherokee on
# chkconfig mysqld on

Create a PHP info page to view your newly install LCMP Stack

# vi /var/www/cherokee/phpinfo.php 


Copy the apc.php file (if you’re using APC) to the same directory.

# cp /usr/share/doc/php53-pecl-apc-3.1.4/apc.php /var/www/cherokee/

Start the required services

# service mysqld start
# service cherokee start

Lastly we’ll configure Cherokee’s default vhost to use PHP (video below)

# cherokee-admin -b


Once that’s done, visit http://your.server.address/apc.php and http://your.server.address/phpinfo.php