
- Image via Wikipedia
One of the most recent Virtual machine operating systems we launched was fedora 12, this OS has proved very popular so i have put together a quick tutorial for setting up the webserver Lighttpd with PHP5 and Mysql.
About Lighttpd
Security, speed, compliance, and flexibility — all of these describe lighttpd (pron. lighty) which is rapidly redefining efficiency of a webserver; as it is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting and many more) lighttpd is the perfect solution for every server that is suffering load problems. And best of all it’s Open Source licensed under the revised BSD license.
lighttpd powers several popular Web 2.0 sites like YouTube, wikipedia and meebo. Its high speed io-infrastructure allows them to scale several times better with the same hardware than with alternative web-servers.
Installing MySQL 5
From your server command line
yum install mysql mysql-server
We now need to create the system startup links for MySQL so that it automatically starts when we boot the server
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
Create a password for the MySQL user root (replace yourrootsqlpassword with the password you want to use):
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword
Installing Lighttpd
Lighttpd is available as a fedora package which makes the installation more straight forward,
once again from the server command line:
yum install lighttpd
Once again need to create the system startup links for Lighttpd so that it automatically starts when we boot the server
chkconfig –levels 235 lighttpd on
/etc/init.d/lighttpd start
To ensure the installation has worked correctly you should open up your browser at your virtual machines IP address:
Example http://124.567.89.10
This should be displaying the default lighttpd holding page
Lighttpd’s default document root is /var/www/lighttpd on Fedora, and the configuration file is /etc/lighttpd/lighttpd.conf.
Installing PHP5
We can make PHP5 work in Lighttpd through FastCGI. Therefore we install the packages lighttpd-fastcgi and php-cli:
yum install lighttpd-fastcgi php-cli
In our next blog post we will look at getting PHP and MySql to work within Lighttpd.
Leave a Comment:
(0 comments)