Light HTTP with MySQL 5 and PHP 5 (LLMP)
OS: CentOS(5.2 - 5.5)
by eServices Greece
Author: George Pantazis
Step 1
Installing MySQL 5
Install the Packages
yum install mysql mysql-server
Setup for automatic start
chkconfig --levels 235 mysqld on
Start MySQL
/etc/init.d/mysqld start
Create the root user for MySQL
mysqladmin -u root password {selected_SQL_root_password}
Set Host ACL
mysqladmin -h {yourdomain or localhost} -u root password {selected_SQL_root_password} -p
Step 2
Install Light HTTPD
Add the repo from dag.wieers since lighttpd isnt included in the default repos.
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Install Lightttpd
yum install lighttpd
Setup for automatic start
chkconfig --levels 235 lighttpd on
Create required directories and fix permissions
mkdir -p /var/run/lighttpd/
chown lighttpd /var/run/lighttpd
Start Lighttpd
/etc/init.d/lighttpd start
Step 3
Installing PHP5
Install PHP & FastCGI
yum install lighttpd-fastcgi php-cli
Edit php.ini
vi /etc/php.ini
Add the following at the end of the configuration file
cgi.fix_pathinfo = 1
Edit lighttpd.conf
vi /etc/lighttpd/lighttpd.conf
Uncomment mod_fastcgi
From:
# mod_fastcgi
To:
mod_fastcgi
Uncomment the fastcgi module setting
Find the string fastcgi.server and uncomment the whole section
Restart Lighttpd
/etc/init.d/lighttpd restart
Step 4
Add MySQL support to PHP
Install any modules you need
(some suggested here)
yum install php-gd php-mysql php-pear php-xml
Restart Lighttpd
/etc/init.d/lighttpd restart
Done :-)