Ubuntu Tips: 5 - Linux, Apache, MySQL and PHP

Article about how to install Apache, MySQL and PHP on your own Ubuntu machine

Author: Matthew Wittering | Published: 1st November 2009

LAMP is the the abbreviation for the software stack which includes; Linux, Apache, MySQL and PHP/Perl/Python used to run the majority of Internet services. Running a machine with the LAMP software stack is a simple exercise. I have configured my Ubuntu machine to run Apache, MySQL and PHP so I may work on programming projects locally with out the need to upload files to some distant web server some where in the cloud.

The Apache HTTP web server is developed and maintained by an open community of developers. The software is free to use on all major operating system platforms. The Apache server will handle content requests made my web browsers whether the content is a static web page of dynamically database driven web application.

Typically the database server of choice for open source developers is the MySQL database application owned by Sun Microsystems. MySQL is used as a storage solution for most popular web applications such as Wordpress, Drupal and phpBB. The scripting language of choice for most Internet programming projects is PHP. The language is used on most programming solutions for the Internet because the PHP language can be embedded easily within HTML to dynamically generate and complete the web page. Carry on reading below to find out how to install Apache, MySQL and PHP on your Ubuntu computer.

Step 1 - Installation

The statement below will install all of the components you will require to run your own home web server. The statement starts by using the sudo command to temporarily grant administrator privileges to your user before using the aptitude package manager to install all the listed components for the Apache web server, MySQL database server, PHP and phpMyAdmin:

$ sudo apt-get install apache2 php5 mysql-client mysql-server phpmyadmin
libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql

Step 2 - Accessing the new services

Once the command has finished executing you will have installed all of the necessary components to run your own web server. You will be able to test that both the Apache Web Server phpMyAdmin MySQL management application are accessible at the following locations:

  1. http://localhost/
  2. http://localhost/phpmyadmin

This work is licenced under a Creative Commons Licence

A brief introduction

Matthew WitteringI am a graduate of Lougborough University where I read Computing and Management BSc (Hons) earning a 2:1 classification.

Currently I am working in the Product Team as a Junior Product Manager at Ask Jeeves UK. Continue