Installing LLMP (Linux, Lighttpd, MariaDB, PHP5/PhpMyAdmin) in Ubuntu 14.04

Lighttpd is an open-source webserver for Linux machines, very fast and very small in size, it doesn’t require a lot of memory and CPU usage which makes it one of the best servers for any project that needs speed in deploying web pages.

Install Lighttpd on Ubuntu 14.04

Install LLMP on Ubuntu 14.04

Lighttpd Features

  1. Support for FastCGI, SCGI, CGI interfaces.
  2. Support for using chroot.
  3. Support for mod_rewrite.
  4. Support for TLS/SSL using OpenSSL.
  5. A Very small size: 1MB.
  6. Low CPU and RAM usage.
  7. Licensed under BSD license.

This article explains how to install Lighttpd, MariaDB, PHP5 with PhpMyAdmin on Ubuntu 14.04.

Step 1: Installing Lighttpd

Fortunately, Lighttpd is available to install from the official Ubuntu repositories, So if you want to install Lighttpd, you only have to run this command.

$ sudo apt-get install lighttpd
Install Lighttpd in Ubuntu

Install Lighttpd in Ubuntu

Once, Lighttpd installed, you can go to your website or IP address and you will see this page which confirm the installation of Lighttpd on your machine.

Verify Lighttpd Page

Verify Lighttpd Page

Before, heading up for the further installation, I would like to tell you that following are the important things of Lighttpd you should know before continuing.

  1. /var/www/ – is the default root folder for Lighttpd.
  2. /etc/lighttpd/ – is the default folder for Lighttpd configuration files.

Step 2: Installing PHP5 and Modules

Lighttpd webserver won’t be usable without PHP FastCI support. Additionally, you also need to install the ‘php5-mysql’ package to enable MySQL support.

# sudo apt-get install php5-cgi php5-mysql

Now to enable PHP module, run the following commands in the terminal.

$ sudo lighty-enable-mod fastcgi 
$ sudo lighty-enable-mod fastcgi-php

After enabling modules, reload the Lighttpd server configuration by running the below command.

$ sudo service lighttpd force-reload

Now to test if PHP is working or not, let’s create a ‘test.php‘ file in /var/www/test.php.

$ sudo vi /var/www/test.php

Press the “i” button to start editing, and add the following line to it.

<?php phpinfo(); ?>

Press ESC key, and write :x and press Enter key to save the file.

Now go to your domain or IP address and call test.php file, like You will see this page which means that PHP is installed successfully.

Install PHP in Ubuntu

Verify PHP Installation

Step 3: Installing MariaDB

MariaDB is a fork from MySQL, it is also a good database server to use with Lighttpd, to install it on Ubuntu 14.04 run these series of commands in the terminal.

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp:// 0xcbcb082a1bb943db
$ sudo add-apt-repository 'deb trusty main'
$ sudo apt-get update
$ sudo apt-get install mariadb-server

During installation, you will be asked to enter the MySQL password you want to use with the “root” user, write the password you want, press the “Tab” button and hit Enter.

Set MySQL Password in Ubuntu

Set MariaDB Password

Retype the password again.

Repeat MariaDB Password

Repeat MariaDB Password

Installing PhpMyAdmin

PhpMyAdmin is a powerful web interface to manage databases online, almost every system admin use it because it is very easy to manage databases using it. To install it on Ubuntu 14.04, run the below command.

$ sudo apt-get install phpmyadmin

During installation, it will show you the below dialog, choose .NO‘.

Install Phpmyadmin in Ubuntu

Install Phpmyadmin

Now choose ‘Lighttpd‘.

Choose Lighttpd Webserver

Choose Lighttpd Webserver

We are almost done here, just run this simple command to create a symlink in /var/www/ to the phpmyadmin folder in /usr/share/.

$ sudo ln -s /usr/share/phpmyadmin/ /var/www

Now go to http://localhost/phpmyadmin and it will ask you to enter root password, that you’ve set above during mariadb installation.

PhpMyAdmin Web Access

PhpMyAdmin Web Access

That’s it, all of your server components are up and running now, You can start deploying your web projects.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Hanny Helal

A Linux & Foss user since 2010, working on many projects in the field of Free Software.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide
The Complete Linux System Administrator Bundle
Become an Ethical Hacker Bonus Bundle

You may also like...

1 Response

  1. Maxmiler says:

    I was only able to access the phpmyadmin url following your tutorial. Everyone else returned a 404 error.

    Thank you!

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.