Install Lighttpd web server, mysql 5.5 and PHP

→ Are you a new visitor? Please visit the page guidance for new visitors ←

Install Lighttpd web server on linux

I’ve wrote a few days back an article about the top web servers on the internet of 2013, Lighttpd was put in last place there, however it is not necessary the last one in the top if you’ve read my article, also there are other web servers out there that could do a better job then all 5. Anyway, Lighttpd was designed for security, speed, compliance, and flexibility, all in one little package. It has been used in the past to serve several big websites like wikipedia, youtube or meebo. The purpose of this web server was to provide:

  • Faster FastCGI
  • Asynchronous IO

The server is an event-driven architecture and is optimized for a large number of parallel connections (keep-alive) which is important for high performance AJAX applications.

In this article I’m going to show you how you can install this web server on linux Ubuntu / Debian operating system, there is no repository needed for Lighttpd so you just need to proceed and run the command:

When you load your local server IP or localhost http://localhost/ you should see a similar page:

Default index page lighttpd

Default index page lighttpd

Install Mysql server 5.5

To install the mysql server you need to run the below command, I’ve started using mysql 5.5 on all my servers, it does the job really well!

This would install the mysql server and it will ask you for the root password. Enter it twice please and you should be finished.

Installing php and php extensions on Debian / Ubuntu

This part is similar to my other tutorials where you installed php on ubuntu / debian installations. You can check here how to install php, mysql and apache.

I will use the same repository / source list to install php 5, on debian which is Dotdeb.  So you edit your source lists ( /etc/apt/sources.list ) and add there the line:

  • for debian wheezy

  • for debian squeeze

You will also need to fetch and install the GnuPG key:

After this you can run the update command to update the apt package list:

Next you can start the php installation and get everything up and ready.

This would get php5-cgi installed and you can link it to your fastcgi module in lighttpd.

Enable Fastcgi module on lighttpd

There is already a configuration available for you to use within the default installation of lighttpd, you just need to create a symbolic link to the conf-enabled folder like bellow:

Once this is completed, restart the lighttpd service and create a phpinfo() page to check if this is working.

You should see a similar result when loading your phpinfo() page:

lighttpd phpinfo

lighttpd phpinfo

That’s about it, hope it helped you guys, and we will see you again in our next tutorial!

Request an article ←