Installing Apache on Ubuntu is a piece of cake as long as you use the tasksel package. This is hands down the easiest way to install the LAMP server, simply open SSH and connect to the target machine. Now that you’re connected, you need to do a little prep work – but it’s nothing to lose sleep over.
Now that tasksel is installed, we can simply run it and choose which pre-configured packages we want. In this case, we will be selecting the LAMP package.
Now select the LAMP package as shown in the image below. Congratulations on installing LAMP on Ubuntu!