- ubuntu

How To Install Apache 2 on Ubuntu

Introduction

The Apache HTTP server is the most widely used web server in the world. It provides many powerful features. In this guide, we will explain how to install an Apache web server on your Ubuntu.

If you first create a new Ubuntu machine, there are few configurations steps. This will help in high security and usability.

Step 1 – Installing Apache

Apache is also available on Ubuntu software repository or you can download and set up with the help of zip file. In this topic, we will install the Apache server from ubuntu default Software repositories. This is also called a conventional package management tool process.

Update your local package index:

$ sudo apt update

Install the Apache2 :

$ sudo apt install apache2

Step 2 – Setup Firewall

$ sudo ufw app list

$ sudo ufw allow 'Apache

Step 3 – Checking your web server

$ sudo systemctl status apache2.service

Output:

apache2.service – LSB: Apache2 web server

   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)

  Drop-In: /lib/systemd/system/apache2.service.d

           └─apache2-systemd.conf

   Active: active (running) since Fri 2019-08-30 06:31:16 UTC; 11h ago

     Docs: man:systemd-sysv-generator(8)

  Process: 30560 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

    Tasks: 11

   Memory: 102.7M

      CPU: 5.729s

   CGroup: /system.slice/apache2.service

           ├─30577 /usr/sbin/apache2 -k start

           ├─30583 /usr/sbin/apache2 -k start

           ├─30584 /usr/sbin/apache2 -k start

           ├─30735 /usr/sbin/apache2 -k start

           ├─31312 /usr/sbin/apache2 -k start

           ├─31313 /usr/sbin/apache2 -k start

           ├─31314 /usr/sbin/apache2 -k start

           ├─32649 /usr/sbin/apache2 -k start

           ├─32650 /usr/sbin/apache2 -k start

           ├─32667 /usr/sbin/apache2 -k start

           └─32668 /usr/sbin/apache2 -k start

Aug 30 06:31:15 ip-172-31-29-17 systemd[1]: Starting LSB: Apache2 web server…

Aug 30 06:31:15 ip-172-31-29-17 apache2[30560]:  * Starting Apache httpd web server apache2

Aug 30 06:31:16 ip-172-31-29-17 apache2[30560]:  *

Aug 30 06:31:16 ip-172-31-29-17 systemd[1]: Started LSB: Apache2 web server.

About techicheez

Read All Posts By techicheez