Skip to content
Corridor V1.26.08 is out, see what's new

Technology

Apache http server (httpd)

Ask AI

How to install and configure Apache httpd as a reverse-proxy web server for the Corridor Platform, including SSL setup.

This section describes how to use apache (https://httpd.apache.org/) as a web server, one of the two reverse-proxy options supported alongside Nginx.

To use HTTPD, it needs to be installed in the system and the daemon should be running with the appropriate site configurations setup.

The official installation instructions can be found at https://httpd.apache.org/docs/2.4/install.html

The recommended method of installation is to use the package manager provided by the Operating System (apt-get, yum, etc.).

RedHat:

Terminal window
yum install httpd

Ubuntu:

Terminal window
apt install apache2

Once installed, the httpd configuration needs to be created to proxy the web server components as described in https://httpd.apache.org/docs/2.4/vhosts/examples.html and https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass

Here is an example httpd configuration that sets up the Web Application Server:

  1. Create the file: /etc/httpd/sites-available/corridorapp.conf with below configs
<VirtualHost *:80>
ServerName www.corridorapp.com
ServerAlias corridorapp
ProxyPass / http://localhost:5002/
ProxyPassReverse / http://localhost:5002/
ErrorLog /var/www/corridorapp/log/error.log
CustomLog /var/www/corridorapp/log/requests.log combined
</VirtualHost>
  1. Create symlink to the above file as /etc/httpd/sites-enabled/corridorapp.conf using the command:

    • This is done to control the configs available versus the subset of those enabled
  2. Add below text to /etc/httpd/conf/httpd.conf: IncludeOptional sites-enabled/*.conf

Configuration example for CentOS (SSL based)

Section titled “Configuration example for CentOS (SSL based)”

To setup a secure connection, update the /etc/httpd/sites-available/corridorapp.conf file as below:

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /certs/app.crt
SSLCertificateKeyFile /certs/app.key
SSLCertificateChainFile /certs/ca.crt
ServerName www.corridorapp.com
ServerAlias corridorapp
ProxyPass / http://localhost:5002/
ProxyPassReverse / http://localhost:5002/
ErrorLog /var/www/corridorapp/log/error.log
CustomLog /var/www/corridorapp/log/requests.log combined
</VirtualHost>