Web-server on Ubuntu (PHP + MySQL + Apache) in 2 commands

Fast and easy install (PHP + MySQL + Apache) LAMP on Ubuntu

Step 1: install tasksel

sudo apt-get install tasksel

Step 2: Run install PHP, MySQL & Apache as LAMP server

sudo tasksel install lamp-server

Completed! Now you have installed PHP, MySQL, and Apache on your Ubuntu

Additional: Create site area

Example of creation mytestsite.com.
Step 1:

mkdir -p ~/sites/mytestsite.com/public

Apache needs to know about our site, then
Step 2:

sudo gedit /etc/apache2/sites-available/mytestsite.com

And add this(please change {LOGIN} on your login in system):

  ServerName mytestsite.com
  ServerAlias www.mytestsite.com
  DocumentRoot /home/{LOGIN}/sites/mytestsite.com/public

After saving run:

sudo a2ensite mytestsite.com

And restart:

sudo /etc/init.d/apache2 reload

Also, if we need that site will be load in browser on our Ubuntu local machine, then do this:

sudo gedit /etc/hosts

And add: localhost mytestsite.com

Now go to /home/sites and create test file index.html with test context

<h1>Hello, world!</h1>

Open your browser and try to load mytestsite.com.

Happy coding!