The detailed documentation for this procedure is here:
https://help.ubuntu.com/community/ApacheMySQLPHP
Our summary is this:
sudo apt-get install apache2
sudo a2enmod rewrite
sudo apt-get install php5
sudo apt-get install mysql-server
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo apt-get install php5-curl
sudo apt-get install php5-xsl
sudo /etc/init.d/apache2 force-reload
sudo nano /etc/php5/apache2/php.ini
sudo apt-get install phpmyadmin
Note that in Ubuntu Server 6.0.6 (dapper), mod_rewrite is disabled by default. By the way, the convention here is to use/configure mod_rewrite per .htaccess file.
Note that libapache2-mod-auth-mysql allows you to use MySQL to authenticate users. For more information on this framework, see "Mod Auth MySQL Under Apache 2 and Debian":
http://www.howtoforge.com/mod_auth_mysql_apache2_debian
Note that you can enable external MySql connections by editing the bind-address line in /etc/mysql/my.cnf.