Setting Up A LAMP Server On Ubuntu
Is extremely easy to do, to say the very least. We’ll be using apt-get to install our packages, since that is the default package manager for the most current versions of Ubuntu, the examples you see here are from Ubuntu 8.10 Intrepid Ibex.
We’re aiming to install four things here: Apache 2, MySQL 5, PHP 5, and phpMyAdmin.
Step 1.) Installing Apache 2 and PHP 5 (Command Line)
apt-get install apache2 php5 libapache2-mod-php5
Step 2.) Installing MySQL 5 Server (Command Line)
apt-get install mysql-server mysql-client php5-mysql
Step 3.) Installing phpMyAdmin (Command Line)
I love that you can install phpMyAdmin from the package manager, installing phpMyAdmin manually is a pain in the ass because you have to recompile php with mcrypt support and loads of other BS, so here’s how to do it in less than 30 keystrokes:
apt-get install phpmyadmin
Step 4.) Finalizing Installation (Command Line)
You will need to append the following line, Include /etc/phpmyadmin/apache.conf, to your Apache 2 configuration file, /etc/apache2/apache2.conf, and restart apache2 when you have done so, by using this command, /etc/init.d/apache2 restart.
Remember to change your root MySQL password, and certainly don’t forget where your configuration files are ( /etc/apache2/apache2.conf and /etc/mysql/my.cnf ) and you’re all set and good to go!
