Install apache on ubuntu

How to install apache2 on Ubuntu

Today we will be installing a web server on Ubuntu


If you get stuck at any point: go see the video from the man who taught me linux: DansCourses Whilst his video is going over the same as my document; there are differences as we all like to do things differently


If there's spelling mistakes, I will probably fix them later as it's 12pm when I wrote this. Good luck!

Create a VM

Click new on Virtual box and make a VM called ubuntu

Select the defaults


Create a VHD now

Click to create a virtual hd now and click next till the menu exits. These are the defaults

Adding the ISO

Please download the ISO for ubuntu server from Ubuntu and save it.


Once downloaded go to disks, select the disk icon and add the ISO. Click open and then it will do the rest.

Bridge interface

Go to network and bridge the connection. Click bridged adapter then your adapter. (usually defautls to the connected one)


Once done close the menu and select start

Apply defaults

Apply the defautls excluding the Language. Use the tab keys to select the language, press space and then select the uk and press space


Once you get to the disk menu, select write changed or done and set up a user name (usually go with Lastname and first enitinal

Enable ssh

Enable ssh by selecting openssh

Skip the other menu unless you need stuff

Skip the menu after by pressing tab space and allowing the install to run

Once the install has completed, select restart and then press enter when prompted.


Log in to the server with you username and password you setup originally. If theres text on the screen press enter and provide your username and password


make note of the Ip address

Make note of the Ip address of the vm. Write this down or something as we will need this in the next step


Mine is 172.16.1.192 (its a private IP)

SSH to the server

ssh to the server by opening a terminal on your computer (ctrl alt t) and typing:

ssh username@ip

My example is: ssh stannardb@172.16.1.192


If it has any prompts accept them by typing yes and the inputting your password

Update and upgrade

Update and upgrade with:

sudo apt-get update && apt-get upgrade -y


This may take a long minute if you're on bad internet

Install apache

Install apache with:

sudo apt-get install apache2 -y

You did it!!

Nice job my guy (or girl) you've install apache

Go to your IP address of the server (in my case 172.16.1.192)

where are the files?

To add files or remove them you need to brows to apaches default site:

in the terminal type:

cd /var/www/html

followed by ls to show the files

make a copy of the index.html

Seeing as we're just going to be editing the default page, were going to make a copy


run:

sudo cp index.html index.html.1

It be broke... now what?

You broke it. Nice one!

Copy the index.html.1 to index.html

Its all good to break it. I got you covered 360 degrees!

run sudo cp index.html.1 index.html

What next?


Good question... Learn html here!


Edit the index.html file with sudo nano index.html


to save it do ctrl x followed by y then enter