How to install Apache2 using ubuntu 16.04

The Apache is an free and open-source cross-platform HTTP Server, Apache web servers are used to serve Web pages requested by client browser, Developed and maintained by Apache Software Foundation.

Step 1 : Installing Apache

By default, Apache repo is already available in ubuntu repo, To install Apache2 in your machine you need to update the repo and use the following commands to install apache2.

sudo -i
apt-get update
apt-get install apache2 -y

by default apache service will start while installationg apache2 package, To test the apache default web page you need to open the web url http://localhost and you should get the web page like this:-

Step 2 : Controlling Apache service

To get status of the Apache2 service use the following commands.

systemctl status apache2

To stop of the Apache2 service use the following commands.

systemctl stop apache2

To reload of the Apache2 service use the following commands.

systemctl reload apache2

To enabled on boot of the Apache2 service use the following commands.

systemctl enable apache2

To disabled on boot of the Apache2 service use the following commands.

systemctl disable apache2

Conclusion

We have successfully installed Apache2 using ubuntu 16.04 Kindly report in case you are facing difficulties with following details.

  • OS name
  • OS version
  • Package name
  • Logs – Error / Warning / failed
How to install Apache2 using ubuntu 16.04

Leave a Reply

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

Scroll to top