How To Install the Apache Web Server on Ubuntu 18.04

Step 1 — Installing Apache

Apache server is available default in ubuntu software repositories, so it can be install conventional package management tools.

Update your local package index:

sudo apt update

Install the apache2 package:

sudo apt install apache2

Step 2 — Adjusting the Firewall

Check the available ufw application profiles:

sudo ufw app list

Output:

Available applications:
  Apache
  Apache Full
  Apache Secure
  OpenSSH

Now allow the normal, unencrypted web traffic from port 80

sudo ufw allow 'Apache' 

Verify the change:

sudo ufw status

Output :

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere                  
Apache                     ALLOW       Anywhere                  
OpenSSH (v6)               ALLOW       Anywhere (v6)             
Apache (v6)                ALLOW       Anywhere (v6)

Step 3 — Checking your Web Server Status

sudo systemctl status apache2

Output :

apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Tue 2019-05-24 20:14:39 UTC; 20min ago
 Main PID: 2532 (apache2)
    Tasks: 55 (limit: 1153)
   CGroup: /system.slice/apache2.service
           ├─2583 /usr/sbin/apache2 -k start
           ├─2585 /usr/sbin/apache2 -k start
           └─2586 /usr/sbin/apache2 -k start

Now access your server using your server ip address

http://your_server_ip_address

Please follow this link

Leave a Reply

Your email address will not be published.Required fields are marked *