Install Apache2 web server

Table of Contents

Note

Apache2 web server provides web page services.

Prepare

Define hosts:

$ gksudo gedit /etc/hosts

Specify:

127.0.0.1 kctang.com.hk <computer name> localhost
127.0.1.1 <computer name>

Define hostname:

$ gksudo gedit /etc/hostname

Specify a line to contain:

<computer name>

Install

Install:

$ sudo apt install apache2

or before Ubuntu 16.04

$ sudo apt-get install apache2

Start service:

$ sudo systemctl start apache2
or
$ sudo service apache2 start

Set the internet router to re-direct http connections to server port 80.