Redirecting unsecure WebView requests to the secure port

Document ID : KB000072219
Last Modified Date : 08/03/2018
Show Technical Document Details
Introduction:
WebView runs under a Jetty v6.0 Web Server.
By default APM does not provide a mechanism to redirect WebView unsecure requests on port 8080 to the secure port 8443 and also with the version of Jetty being used it is not possible to configure a redirect within the Jetty Web Server itself. 
This solution uses an Apache HTTP Web Server running on port 8080 and configuring it to redirect all requests to the WebView secure port.
Instructions:
The steps are:
1. Install Apache HTTP Server 2.4.x which can be downloaded from the APACHE HTTP SERVER PROJECT page: http://httpd.apache.org
NOTES:
The Apache Web Server can be installed on the WebView server (mywebviewserver) or on any server (myapacheserver) which can connect to the Web View server.
If installing on the WebView Server then WebView must only be running on the secure port 8443 and not on the unsecure port 8080.
In either case after implementing this solution having WebView running on the unsecure port 8080 becomes redundant.
By default if secure WebView is enabled ("introscope.webview.tcp.port" is commented in the IntroscopeWebView.properties file) then the default webview-jetty-config.xml file only enables the secure connector. 

2. Make the following changes in the Apache file conf/httpd.conf:
Change "Listen 80" to "Listen 8080"
Uncomment line "LoadModule rewrite_module modules/mod_rewrite.so"
Uncomment line "LoadModule proxy_module modules/mod_proxy.so"
Uncomment line "LoadModule proxy_http_module modules/mod_proxy_http.so"
Uncomment line "Include conf/extra/httpd-vhosts.conf"

3. Make the following changes in the Apache file conf/extra/httpd-vhosts.conf:
Comment out any existing VirtualHost section. 
Add the following virtual host where mywebviewserver is the hostname where WebView is running on port 8443
<VirtualHost *:8080>
    DocumentRoot "C:/Apache24/htdocs"
    ErrorLog logs/webview_redirect_error.log
    CustomLog logs/webview_redirect_access.log combined
    LogLevel error
    <Directory "C:/Apache24/htdocs">
        Options MultiViews FollowSymLinks
        AllowOverride all
        Require all granted
    </Directory>
    RewriteEngine On
    RewriteRule "^/(.*)" "https://mywebviewserver:8443/"
</VirtualHost>


4. Start the Apache HTTP server and load it's home page http://myapacheserver:8080
It will then redirect to the WebView/APM Team Center Login page: https://mywebviewserver:8443/ApmServer
Additional Information:
Credit to this page where most of the above steps were found: http://coderevisited.com/redirect-from-apache-http-server-to-jetty/
Related APM documentation links:
https://docops.ca.com/ca-apm/10-7/en/administrating/properties-files-reference/introscopewebview-properties#IntroscopeWebView.properties-JettyWebServerConfiguration
https://docops.ca.com/ca-apm/10-7/en/administrating/configure-enterprise-manager/configure-enterprise-manager-communications#ConfigureEnterpriseManagerCommunications-JettyConfigurationOptionsforSSL