What is Apache Web Server and How we perform reverse Proxy

Posted By :Nitin Kumar Kashyap |6th August 2021

 

What is Apache Web Server? 

 

AWS is one of the most commonly used web servers in Linux-based operating system machines. It is used to serve the web pages which are requested by the client systems. Typically, client requests and views web pages using web browser applications such as chrome, edge, etc. 

 

The HTTP server is a free and open-source web-based server that delivers web content through internet access and connectivity. Apache Web Servers (AWS) are used after the development, and it quickly became the most popular client, HTTP. Apache is used widely and gets its name from the development history and process of improvement through applied patches and modules, but it was corrected back in 2000. It was then revealed that the name originated from the point of resilience and durability. 

 

Why Apache Web Servers? 

 

It is considered an open-source software, and its source code is freely available for viewing and collaboration. An open-source-made Apache web server is prevalent in developers who have built. It has been configuring its modules to apply specific functions and also improving on its core features. It has been around since 1995, and it is responsible as a core technology that helped in the initials growth of the internet using its efficiency. 

 

It can handle large amounts of traffic with minimum configuration. It also scales with an easy modular functionality of its core whenever you try to configure Apache. It is a light-weighted and efficient web server. You can also add SSL, server-side programming, Load balancing configurations to handle the traffics. It is used in windows, Linux-based OS, and Mac-based Operating systems. 

 

Features of Apache Web Servers 

 

  • It handles the static files. 
  • It also balances Loadable dynamic modules. 
  • It has a feature of auto-indexing. 
  • It is compatible with IPv6. 
  • It supports Geo-locations based IP addresses. 
  • It uses URL rewriting.
  • It supports scripting such as Perl, PHP, Lua, etc.
  • It also used FTP connections. 
  • It as well as supports compression and decompression. 
  • It supports HTTP. 
  • It supports session tracking. 

 

 

List of some alternatives of Apache Web Server. 

 

  1. Nginx
  2. Apache Tomcat
  3. Node.js
  4. Lighttpd
  5. Cherokee
  6. Microsoft IIS
  7. Appweb

 

 

Configurations Of Apache Web Server

 

It is configured by placing directives in the plain text configurations of the files. 

 

Apache2.conf: It is the main configuration file; it contains the global setting of apache2. 

 

Httpd.conf: The main Apache2 configurations files which named after the HTTP daemon. In some other older distributions, all configurations options have been moved to apache2.conf.

 

Conf-available: In this directory contains available files of the configurations. All other files were previously found in /etc/apache2/conf.d, which were moved to /etc/apache2/conf-available.

 

Conf-enabled: It can store or find the symlinks of the files /etc/apache2/conf-available.

 

Envvars: It has files where Apache2 environments variables are to be set.

 

Mods-available: This directory contains configurations files for both load modules and configures them.

 

Mods-enabled: It holds the symbolic links to the files which contain/etc/apache2/mod-available. After creating any new symlink, you have to restart the apache2 service. 

 

Ports.conf: It has a directive that defines which TCP ports apache2 listen on the port. 

 

Sites-available: This folder has been configured the files for the Apache virtual hosts. It has allowed Apache2 to be configured for multiple sites that have separate configurations.

 

Sites-enabled: This folder or directory contains the symlink of the /etc/apache2/site-available folder.

 

Note: After making any changes in configurations files. You have to restart or reload the apache service

 

Steps to install the Apache2 web server

 

Step 1-: First update and upgrade the system with the use of the following commands.

 

Commands: 

sudo apt update

sudo apt -y upgrade

 

Step 2-: Install the apache2 Web Server with the use of the following command.

 

Command:

sudo apt install apache2 -y

 

Step 3-: For the enable reverse proxy configurations we have to use some modules like mod_rewrite, mod_headers, mod_proxy_http, and mod_proxy_wstunnel. To enable these modules.

 

commands:
sudo a2enmod rewrite

a2enmod headers

a2enmod proxy_http

a2enmod proxy_wstunnel

 

Step 4-: For the enable reverse proxy paste the following configuration for the following in the site-available directory.

 

[Paste code for proxy]

     ProxyPreserveHost On

     ProxyPass /api http://(IP or domain-name):8085/api
     ProxyPassReverse /api http://(IP or domain-name):8085/api

 

Step 5-: After that restart or reload the apache2 Web Server. 

 


Command:
sudo systemctl reload or restart apache2.service


To test the output you can check your browser for this-

 

 

Now this will be the result of a reverse proxy.

 


 

Conclusion: In the end, we have successfully completed the Apache Web Server reverse proxy.

 


About Author

Nitin Kumar Kashyap

Nitin is DevOps engineer. He isfamiliar with AWS and Azure Cloud. He also have an hands on work over docker and orchestrations tools.

Request For Proposal

[contact-form-7 404 "Not Found"]

Ready to innovate ? Let's get in touch

Chat With Us