One way to get the complete LAMP(GNU/Linux + Apache + MySQL + PHP) stack installed and configured on Ubuntu operating system is to use the Server install CD version of the distribution. Ubuntu 6.10 Server Edition, for example, provides a menu option during the installation to install a complete LAMP server on the machine. No desktop environment or unnecessary packages will be installed, so this is the preferred way to run a dedicated LAMP stack on a machine. Once installed this way, one can easily login to this machine remotely and tweak the default configuration settings.

For those who would like to run the LAMP stack on their personal desktops(for development and testing purposes for example), selecting a few packages will get all the required components installed. There is an easier way though: Select the LAMP task from the Synaptic Package Manager and install everything with a single selection:

  • Start Synaptic Package Manager, go to Edit -> Mark Packages by Task… and select LAMP Server from the list of options. Click OK and then click the “Apply” button on the toolbar.

This will install the default list of packages that are part of LAMP installation. I prefer to install additional packages too, like GUI tools to work with the databases. The following two commands will install LAMP and some additional packages related to it:

Basic LAMP Installation:

sh# sudo apt-get install apache2 mysql-server mysql-client-5.0 php5 php5-mysql

Additional LAMP related packages:

sh# sudo apt-get install php5-cgi php5-cli php5-gd php5-imagick php5-json php5-odbc postgresql php5-pgsql php5-sqlite php-auth php-doc mysql-admin mysql-query-browser apache2-doc pgadmin3 pgdocs-pdf phppgadmin

To know more about these additional packages, search for them in the Synaptic Package Manager and read their descriptions. Though PostgreSQL is not technically a part of LAMP stack, it is a good alternative to MySQL DBMS and and fits equally nicely with Apache and PHP combination. These are the applications that I install on my machine; to browse through the entire collection of packages related to the LAMP stack, search for ‘apache’, ‘php’ and ‘mysql’ in Synaptic Package Manager(Edit -> Search) and select your own favourite packages to install from the result list. Installing the complete LAMP stack and related packages is similar for Kubuntu operating system, with Adept Package Manager taking the place of Synaptic Package Manager.