How to Install Apache Web Server on Ubuntu 16.04

how to install apache on ubuntu 16.04

Introduction:

Apache web server is an open source and free platform. It is developed and maintained by apache foundation. The Apache web server is safer and faster.

In this tutorial I will explain how to install an apache web server on Ubuntu 16.04.

Install Apache2 web server:

Before beginning, we will update the local package. After that, we can install an apache2 package.

To install an apache run the following commands below:

sudo apt-get update
sudo apt-get install apache2

Acess web:

After the installation process, Ubuntu 16.04 begins to start apache. Make sure the apache web server is running with systemd init system

sudo systemctl status apache2

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 Sat 2020-04-11 07:07:48 UTC; 1 day 22h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 7558 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 18881 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
  Process: 7582 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
    Tasks: 11
   Memory: 115.8M
      CPU: 58.435s
   CGroup: /system.slice/apache2.service
           ├─ 7599 /usr/sbin/apache2 -k start
           ├─18925 /usr/sbin/apache2 -k start
           ├─23228 /usr/sbin/apache2 -k start
           ├─23234 /usr/sbin/apache2 -k start
           ├─23237 /usr/sbin/apache2 -k start
           ├─23247 /usr/sbin/apache2 -k start
           ├─23249 /usr/sbin/apache2 -k start
           ├─24642 /usr/sbin/apache2 -k start
           ├─24644 /usr/sbin/apache2 -k start
           ├─27063 /usr/sbin/apache2 -k start
           └─27157 /usr/sbin/apache2 -k start

Apr 11 07:07:47 ubuntu-s-2vcpu-4gb-nyc3-01 systemd[1]: Starting LSB: Apache2 web server...
Apr 11 07:07:47 ubuntu-s-2vcpu-4gb-nyc3-01 apache2[7582]:  * Starting Apache httpd web server apache2
Apr 11 07:07:47 ubuntu-s-2vcpu-4gb-nyc3-01 apache2[7582]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' dire
Apr 11 07:07:48 ubuntu-s-2vcpu-4gb-nyc3-01 apache2[7582]:  *
Apr 11 07:07:48 ubuntu-s-2vcpu-4gb-nyc3-01 systemd[1]: Started LSB: Apache2 web server.
Apr 12 06:25:01 ubuntu-s-2vcpu-4gb-nyc3-01 systemd[1]: Reloading LSB: Apache2 web server.
Apr 12 06:25:01 ubuntu-s-2vcpu-4gb-nyc3-01 apache2[18881]:  * Reloading Apache httpd web server apache2
Apr 12 06:25:01 ubuntu-s-2vcpu-4gb-nyc3-01 apache2[18881]:  *
Apr 12 06:25:01 ubuntu-s-2vcpu-4gb-nyc3-01 systemd[1]: Reloaded LSB: Apache2 web server.

Acess web:

Enter your domain name or ip address in your browser

http://ip_address

Apache process management:

To stop apache server

sudo systemctl stop apache2 

To start apache server

sudo systemctl start apache2 

To restart apache server

sudo systemctl restart apache2 

To reload server

sudo systemctl reload apache2 
Exit mobile version