Installing Apache, MySQL, PHP (LAMP) on Ubuntu 14.04

What is LAMP?

LAMP named as an acronym of the names of its components: Linux, Apache, MySQL and PHP.

Before Installing

We need to update our system to make sure that our system is currently using updated repositories and PPAs.

# sudo apt-get update

1. Install Apache HTTP Server

# sudo apt-get install apache2

Note: To check if Apache HTTP Server is running, visit your server's IP address using your web browser.

2. Install MySQL

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

First, we need to create the database directory where it will store its information.

# sudo mysql_install_db

Then, we need to run this Simple Security System. In this step you will be asked to change your MySQL root password, remove anonymous user accounts, remove test databases, and disable remote root login.

# sudo mysql_secure_installation

3. Install PHP

# sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

We need to make Apache search for PHP files first:

# sudo nano /etc/apache2/mods-enabled/dir.conf

Directory Config should look like this:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.php index.xhtml index.htm

We need to move index.php after DirectoryIndex. Then, it should look like this:

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.xhtml index.htm

In order for our changes to be recognized, we need to restart our Apache:

# sudo service apache2 restart

Congratulations! You have now set up and configured a simple LAMP environment.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I manage my VPS Server?

We provide you with a very simple interface for controlling your VPS unmetered bandwidth from...

How to install MySQL

Here is a step by step how to install MySQL and secure it for your unlimited VPS hosting. You...

How to Install Apache2 and PHP5 on Ubuntu

Installing Apache2 and PHP5 is super simple on Ubuntu: # apt-get install apache2# apt-get...

How to Install MySQL on Ubuntu

Learn how to install MySQL on your DDoS protected dedicated server or DDoS protected VPS if...

Installing Node.js on CentOs 5

Installing node.js on a cheap VPS with unlimited bandwidth is pretty simple. For more information...