HowTo: Setup Lighttpd & MySQL 5 & PHP 5


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
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

# 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 :-)



  • 29 Users Found This Useful
Was this answer helpful?

Related Articles

Rapid SSL CA Bundle

You will find the bundle here:

Set Correct Time and Timezone

For Dedicated servers & VMWare just set the time using date -s "17 JUN 2010 19:54:00"...

Mysql Optimized configuration (centos 5.2-5.5, openSUSE11.0-11.3)

==========[my.cnf]==========       [client] port        ...

Lighttpd Optimized configuration (centos 5.2-5.5, openSUSE11.0-11.3)

==========[lighttpd.conf]==========       # lighttpd configuration file # #...

Python Script to Create XEN MAC's

  #! /usr/bin/python # (c) 2010 George Pantazis -...