Install Basic LAMP server on Ubuntu 18.04

This is just one of those things that I don’t do often enough to remember. I thought it would be a good idea for me to put it into a knowledge base article so I don’t have to waste my time going to the all knowing Google.

The first thing to do is make sure your Ubuntu server is up to date with this command:

sudo apt update && sudo apt upgrade -y

This only takes a few seconds to run and updates and upgrades all the packages in one fell swoop. The next thing we install is tasksel with this command:

sudo apt install tasksel

Once that is installed we can run this command

sudo tasksel install lamp-server

This will install all LAMP server dependencies. If you want to make sure your apache server is running you can type the command:

service apache2 status

This will output this:apache

Press CTRL c to go back to the bash. Now I want to see if PHP was installed correctly. type:

php-version

This will be on your screen:

php

Next type in the ip address of your new server in the url bar of your favorite browser. You should see this:

apache2

Now we will want to see if PHP is working properly. Go to the /var/www/html file and create a file named info.php. (I like to use nano, but some prefer vi or vim.) The file will contain this code:

<?php phpinfo() ?>

Type in (ip_address)/info.php and you should see this:

php2

Your LAMP server should now be basically configured! Now go have fun creating an awesome website or application!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close