×


Steps to install Apache web server on Ubuntu 20.04 LTS ?

Need to configure Apache on your Debian Server?

This guide is for you.


Apache is the most commonly used Web server on Linux systems. Web servers are used to serve Web pages requested by client computers. 

This configuration is termed LAMP (Linux, Apache, MySQL and Perl/Python/PHP) and forms a powerful and robust platform for the development and deployment of Web-based applications.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to configure Nginx on their Server.

In this context, we shall look into how to install and configure Apache on Linux server.


How to install Apache on Ubuntu ?

Apache is the most popular web server developed by Apache Software Foundation. It offers several features that make it very useful for websites. Apache HTTP server is supported on all operating systems including Linux, Windows, MacOS, FreeBSD, etc. It is also a part of the web service stack-LAMP stack.


Apache is available in the official repositories of Linux Ubuntu. Therefore, we can easily install it using the apt-get install command. 

Following are the steps to install Apache on Linux.


1. Update System Repositories

First, Login into your Server as the root user or with sudo privileges update the system repositories using the following command in Terminal:

$ sudo apt-get update


2. Install Apache

Now in order to install Apache, issue the following command in Terminal:

$ sudo apt-get install apache2

When prompted for confirmation, hit y, after which the installation of Apache will be started on your system. 

Depending on your network connection, the installation of Apache may take some time.


3. Verify Apache Installation

Once the installation of Apache is completed, you can verify it using the following command in Terminal:

$ apache2 -v

Now the version of Apache installed will be displayed as an output to the above command.


You can also view the status of Apache service to verify if it is properly running. Issue the following command in Terminal to do so:

$ systemctl status apache2

The active (running) status in the output shows that the Apache service is active and running.

In case, the service is not started automatically, you can start it using the below command:

$ sudo systemctl start apache2


How to Access Apache Default Webpage ?

You can also confirm if the Apache service is successfully running by accessing the Apache default webpage. To do so, type your system's hostname or IP address in the location bar of any browser.

http://<host_name or ip_address>

You will see a page which shows that Apache has been successfully installed on your system.

If you want to access the Apache from another system on the network, you will need to configure a rule in the firewall settings.


How to Remove Apache from Ubuntu ?

In case, you no longer need Apache server on your system, you can easily remove it using the below command:

$ sudo apt-get remove apache2

When prompted for confirmation, hit y, after which the system will remove Apache.


[Need urgent assistance to install and Configure Apache on your Linux Server? We are available to help you. ]


Conclusion

This article will guide you on steps to #install and configure #Apache on #Linux server.

Apache is one of the most popular web servers that allows you to run a secure website without too much of a headache.

#HTTPD is a program that is (essentially) a program known as Apache Web server. The only difference I can think of is that on Ubuntu/Debian the binary is called apache2 instead of httpd which is generally what it is referred to as on RedHat/CentOS. Functionally they are both 100% the same thing.

Apache server root will be located in /etc/httpd. The path to the apache #program will be /usr/sbin/httpd. In the document root three directories are created: cgi-bin, html and icons.

By default, Apache web server is instructed to listen for incoming connection and bind on port 80. If you opt for the TLS configuration, the server will listen for secure connections on port 443.

To start Apache server on Debian / Ubuntu Linux Specific Commands to Start/Stop/Restart Apache:

1. Restart Apache 2 web server, enter: # /etc/init.d/apache2 restart. $ sudo /etc/init.d/apache2 restart.

2. To stop Apache 2 web server, enter: # /etc/init.d/apache2 stop.

3. To start Apache 2 web server, enter: # /etc/init.d/apache2 start.