Comments on Ubuntu 18.04 (LTS) LAMP server tutorial with Apache, PHP 7.2, and MySQL

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache 2.4 web server on an Ubuntu 18.04 (Bionic Beaver) server with PHP 7.2 support (mod_php) and MySQL / MariaDB and how to setup an SSL certificate with Let's encrypt. Additionally, I will install PHPMyAdmin to make MySQL administration easier. A LAMP setup is a perfect basis for CMS systems like Joomla, Wordpress or Drupal.

28 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Mohamed Kamal

 This page is very usefull. Thank you for your effort but when I tried to install mysql I was not prompted for root password as with previous versions of ubuntu and I am still stuck there any suggestions?...

By: till

Maybe it was already installed or your server is using other non-standard apt settings which hide that dialog. Try to use the mysql_secure_installation command to set a password and enter no password when it asks for the old password.

By: Sajjad

Awesome!

By: Tom

Works perfectly, thanks!

By: OgtayHuseynov

How can i disable mysql on ubuntu 18.04?

By: omar

Enable mysql on ubuntu 18.04, Have you tried to:

sudo -H gedit /etc/apache2/apache2.conf

Then add the following line to the end of the file:

Include /etc/phpmyadmin/apache.conf

Then restart apache:

/etc/init.d/apache2 restart

By: Daz

Great tutorial!

The only bit I could not get working was the SSL, but as this is only on my local laptop for dev purposes, I'm not too worried - although I will try again, just for completeness!

 

By: till

Let's encrypt requires it that the domain that you like to get the SSL cert for exists in DNS and is publicly reachable. That's probably not the case on a dev system on your laptop. But you should be able to use a self-signed SSL cert as described in chapter 7, just leave out chapter 8 on your local dev system.

By: hjsimosa

Great work guys. Thanks.

Hector

By: mina

where is the Virtual machine image you are mintiend how i could download it ??

By: till

See big red download icon in the menu on the right side of the page, below that icon you can find the download link.

By: Rui Cascalheiro

Thats a fantastic guide. Many thanks for the good job. :)

By: Ualas

Thanks my brother! I am from Brazil. nothing find in portuguese for help me.

By: Richy

Works perfectly, thanks!

By: marqpdx

Great tutorial, super useful and very tight. Thank you!

Well done.

By: chubbyChecker

this is missing how to open ports, i guess it assumes you are working from the same computer

By: Spatial

Thank you Mr. Brehm. I always were forgetting some of the steps in this process of installation. Now, I can rely on this post and easily set up the server. Added to my bookmarks!

By: Jorge Carbwood

Great tutorial and easy to follow. 

By: Adrian

Thank you, everything worked!

By: MemoGuard

Thank you for the job, works perfectly :-)

By: Allie Syadiqin

After installing phpMyAdmin and following all the steps, I cannot access phpMyAdmin. All I get is a 404 error page.

By: till

This means that you did not select 'Apacahe2' during phpMyAdmin installation. Run 'dpkg-reconfigure phpmyadmin' and select it this time. Please note, an option in apt is selected with the space bar of your keyboard after you navigated to it using the tab keys.

By: Hermann

I have the same problem like Allie but after running 'dpkg-reconfigure phpmyadmin'and choose apache2 server, the problem still remains

By: Ricardas

nano /etc/apache2/apache2.conf

at the end of file add this:

Include /etc/phpmyadmin/apache.conf

Restart apache

By: John

Thanks but on Ubuntu 18.04 fresh install, The MariaDB step killed MySQL, leaving my machine useless. Now the root pass I set first in MySQL doesn't work - and the MariaDB cannot progress with enter key. I came here to avoid doing what I did before. Guess I followed this twice, fool me that many times.

By: Ezry

Hiu,

Many Thx for this Tutorial, it was a little bit complicate for me,  my English is'nt perfect, now i can use phpmyadmin, there was no way before i've read your Tut. One Question have i, to create a User , and give the the Privileges , must i write " GRANT ALL PRIVILEGES" or can ist write "grant all privileges" too??

Now is it a little bit easier for me to say byebye to Windows;))

 

greetings

Ezry

By: Viktor

Thank you so much for posting!

By: Mary Preziosi

Thank you for this! Excellent step by step instructions were very useful to me.