Security, speed, compliance, and flexibility — all of these describe lighttpd (pron. lighty) which is rapidly redefining efficiency of a web server; 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.
Here i will explain you the installation of Lighttd with PHP and MySQL on Linux Mint 12.
To start off we will install Lighttpd.
Type following Command on the Terminal and then press enter.
[email protected]~/$ sudo apt-get install lighttpd
Start the Lighttpd by using the following command.
[email protected]~/$ sudo /etc/init.d/lighttpd restart
To make sure everything installed correctly we will now test Lighttpd to ensure it is working properly. Open up any web browser and then enter the following into the web address:
http://127.0.0.1/index.lighttpd.html or http://your.ip.addr.ess/index.lighttpd.html
You should see the Lighttpd Placeholder page, lighttpd’s default document root is /var/www/ on Ubuntu / Linux Mint; the configuration file is /etc/lighttpd/lighttpd.conf and additional configurations are stored in the /etc/lighttpd/conf.available/ directory.
[email protected]~/$ sudo apt-get install mysql-server mysql-client php5-mysql
After the installation it will ask you to configure the MySQL root password, so just enter the password.
Re-enter the password to confirm.
[email protected]~/$ sudo apt-get install php5-cgi
Configuring PHP5 and Lighttpd:
To enable PHP5 in Lighttpd, you will have to modify the configuration file /etc/php5/cgi/php.ini and uncomment the line cgi.fix_pathinfo=1:
To enable the FastCGI configuration (which is stored in /etc/lighttpd/conf-available/10-fastcgi.conf), run the following command:
[email protected]~/$ sudo lighttpd-enable-mod fastcgi [email protected]~/$ sudo lighttpd-enable-mod fastcgi-php
To reload the server for changes to take place, type in the terminal.
[email protected]~/$ sudo /etc/init.d/lighttpd force-reload
For testing the PHP, Place one PHP file on to the default directory of the Lighttpd.
In the terminal copy/paste the following line:
[email protected]~/$ sudo gedit /var/www/info.php
This will open up a file called phpinfo.php.
Copy/Paste this line into the info file:
Save and close the file.
Now open you’re web browser and type the following into the web address:
The page will look like below:
As you see in the screenshot, PHP5 is working fine, and it is working through FastCGI, as shown in theServer API line. If you scroll further down, you will see all modules that are already enabled in PHP5; look the support information of MySQL.
Now your web server is ready for working.