In this KB article, we describe the steps needed to configure the Apache httpd web server as a reverse proxy in front of Base View and the User Portal.
With this setup, it is possible to assign a certificate signed by a public certification authority. Also, port 443 can be exposed instead of the default port 8081.
The first step is to create the configuration files userportal.conf and base-view.conf for the reverse proxy.
The following file format can be used:
# cat > /etc/httpd/conf.d/userportal.conf << _EOF_RewriteEngine onRewriteRule ^/(userportal)/(.*)$ https://%{SERVER_NAME}/\$1/\$2 [R,L]RewriteRule ^/(userportal)$ https://%{SERVER_NAME}/\$1/ [R,L]
ProxyPreserveHost OnProxyRequests OffSSLProxyEngine onSSLProxyVerify noneSSLProxyCheckPeerCN offSSLProxyCheckPeerName offSSLProxyCheckPeerExpire offProxyPass /userportal/ https://127.0.0.1:8081/userportal/ProxyPassReverse /userportal/ https://127.0.0.1:8081/userportal/ProxyPass /json https://127.0.0.1:8081/jsonProxyPassReverse /json https://127.0.0.1:8081/jsonProxyPass /shell https://127.0.0.1:8081/shellProxyPassReverse /shell https://127.0.0.1:8081/shell_EOF_
# cat > /etc/httpd/conf.d/base-view.conf << _EOF_RewriteEngine onRewriteRule ^/(base-view)/(.*)$ https://%{SERVER_NAME}/\$1/\$2 [R,L]RewriteRule ^/(base-view)$ https://%{SERVER_NAME}/\$1/ [R,L]ProxyPreserveHost OnProxyRequests OffSSLProxyEngine onSSLProxyVerify noneSSLProxyCheckPeerCN offSSLProxyCheckPeerName offSSLProxyCheckPeerExpire offProxyPass /base-view/ https://127.0.0.1:8081/base-view/ProxyPassReverse /base-view/ https://127.0.0.1:8081/base-view/ProxyPass /json https://127.0.0.1:8081/jsonProxyPassReverse /json https://127.0.0.1:8081/jsonProxyPass /shell https://127.0.0.1:8081/shellProxyPassReverse /shell https://127.0.0.1:8081/shell_EOF_
Note that on Ubuntu hosts, the userportal.conf and base-view.conf files should be placed into the /etc/apache2/conf-available/ directory, not /etc/httpd/conf.d, and the following commands will need to be run to enable the configurations, modules, and site.
Ubuntu only:# a2enconf userportal base-view# a2enmod rewrite proxy ssl proxy_http# a2ensite default-ssl
The second step is to make the following changes to the constants.php file:
# sed -i 's_:8081/userportal_/userportal_g' /var/www/html/constants.php
# sed -i 's_:8081/base-view_/base-view_g' /var/www/html/constants.php
Now it is possible to access the user portal using the standard HTTPS port 443.
To figure out where you store your new certificate files on your head node, take a look at /etc/httpd/conf.d/ssl.conf on your head node (that’s /etc/apache2/sites-available/default-ssl.conf for Ubuntu hosts), specifically the following directives:
SSLCertificateFileSSLCertificateKeyFileSSLCertificateChainFile
With these configurations in place, reload the Apache httpd webserver:
# systemctl reload httpd # systemctl reload apache2