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.
Installation
Section titled “Installation”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:
yum install httpdUbuntu:
apt install apache2Configurations
Section titled “Configurations”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
Configuration example for CentOS
Section titled “Configuration example for CentOS”Here is an example httpd configuration that sets up the Web Application Server:
- Create the file:
/etc/httpd/sites-available/corridorapp.confwith 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>-
Create symlink to the above file as
/etc/httpd/sites-enabled/corridorapp.confusing the command:- This is done to control the configs available versus the subset of those enabled
-
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>Was this page helpful?
Thanks for the feedback.