Apache is a web server which is used to serve the http request from a client computer. A client can open a webpage to view the website using web browsers like chrome, firefox etc. and browsers sent their requests to web servers like apache http server.
How to install Apache Web Server on Ubuntu ?
We can install apache using the package management tools.
Step 1
First of all update local package index
sudo apt update
Step 2
Install apache package
sudo apt install apache2
After installation you can verify the installation using below command
sudo service apache2 status
This will output:
apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor prese> Active: active (running) since Fri 2021-08-27 02:48:18 UTC; 1 day 7h ago Docs: https://httpd.apache.org/docs/2.4/ Process: 17783 ExecReload=/usr/sbin/apachectl graceful (code=exited, status> Main PID: 580 (apache2) Tasks: 8 (limit: 1159) Memory: 104.1M CGroup: /system.slice/apache2.service ├─ 580 /usr/sbin/apache2 -k start ├─17791 /usr/sbin/apache2 -k start ├─17792 /usr/sbin/apache2 -k start ├─17793 /usr/sbin/apache2 -k start ├─17794 /usr/sbin/apache2 -k start ├─17795 /usr/sbin/apache2 -k start ├─17814 /usr/sbin/apache2 -k start └─18382 /usr/sbin/apache2 -k start Aug 27 02:48:18 ip-xx-xx-xx-xxx systemd[1]: Starting The Apache HTTP Server... Aug 27 02:48:18 ip-xx-xx-xx-xxx systemd[1]: Started The Apache HTTP Server. Aug 28 00:00:54 ip-xx-xx-xx-xxx systemd[1]: Reloading The Apache HTTP Server. Aug 28 00:00:54 xx-xx-xx-xxx systemd[1]: Reloaded The Apache HTTP Server.
If the apache is running then it will show as above. you can also read how to start, stop, restart and check status of apache article.
Step 3
Check the firewall and allow it
sudo ufw app list sudo ufw allow 'Apache'