The Apache HTTP Server is a open-source HTTP server for modern operating systems including UNIX and Windows. Apache provides a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
This post details, how you can install and setup the apache webserver on Ubuntu.
Install Apache Webserver
$ sudo apt-get install apache2
Once above command is installed apache2 successfully without any error, you can see that apache server is running by following command as,
$ systemctl status apache2.service ● 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 Mon 2020-05-18 23:58:33 IST; 12s ago Main PID: 8807 (apache2) Tasks: 55 (limit: 4915) CGroup: /system.slice/apache2.service ├─8807 /usr/sbin/apache2 -k start ├─8808 /usr/sbin/apache2 -k start └─8809 /usr/sbin/apache2 -k start May 18 23:58:33 devlab systemd: Starting The Apache HTTP Server... May 18 23:58:33 devlab apachectl: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this m May 18 23:58:33 devlab systemd: Started The Apache HTTP Server.
Now, you can check that webserver is running by visiting its home page as http://localhost OR http://YOUR_IP in browser
NotE: If you have seen an error like “systemd: Failed to start The Apache HTTP Server.” refer to our another post “Solved: systemd: Failed to start The Apache HTTP Server.” to fix this error.