It doesn’t get easier than this. Open up a terminal in Ubuntu and type
sudo tasksel
An ncurses screen will then allow you not only to install a LAMP server in three moves but also select a Samba, Tomcat Java server, OpenSSH, VM host server, DNS server or one of the existing Ubuntu spring-offs.