Configuring Apache HTTP Server or IBM HTTP Server in Cognos Analytics 11.0.4

Applies to version 11.0.4 and subsequent versions unless specifically overridden

After you complete this procedure, the server can handle requests for static files (such as .js, .html, .css), load balance requests to IBM Cognos Analytics, and route SSO requests through the IBM Cognos Analytics gateway code.

Before you begin

At least one instance of a Cognos Analytics server must be configured and running. It should be reachable from the web server with a URL similar to: http://host name of the IBM Cognos Analytics server1:9300/bi. Use mod_proxy_balancer to load-balance requests between multiple Cognos Analytics instances. For the options for load balancing, see Apache documentation.

About this task

The configuration in this task configures sticky session load balancing. You can monitor and configure the load balancer at http://web_server_host_name/ibmcognos/balancer-manager

The expires_module adds response headers to requests that indicate to the browser how long it can hold the returned resource before checking for new versions. The deflate_module performs compression of the resources before they are sent, saving bandwidth.

Differences by platform are indicated below with  comments . The references to the cognos_module in the configuration below are only required if you are configuring single sign-on (SSO). If SSO is not required, you don't need the cognos_module.

Procedure

  1. In the apache/conf directory, create an empty file called cognos.conf.
  2. Open the cognos.conf file in a text editor.

    The following applies to Apache 2.2 and Cognos Analytics versions Applies to version 11.0.4 and subsequent versions unless specifically overridden. Make the changes to the code as shown in the following examples as they apply to your environment. Some values in the code are for example only. For more information about the Apache directives that can be used, see http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html.

    # cognos.conf for  Apache 2.2  and  IHS 8 
    LoadModule headers_module modules/mod_headers.so 
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule expires_module modules/mod_expires.so
    LoadModule filter_module modules/mod_filter.so
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    LoadModule deflate_module modules/mod_deflate.so
    
     # Apache 2.2 UNIX 
     LoadModule cognos_module "/opt/IBM/cognos/analytics/cgi-bin/mod2_2_cognos.so"
    
     # Apache 2.2 Windows 
     LoadModule cognos_module "c:/IBM/cognos/analytics/cgi-bin/mod2_2_cognos.dll"
    
    
    
    <IfModule mod_expires.c>
        <FilesMatch "\.(jpe?g|png|gif|js|css|json|html|woff2?|template)$">
            ExpiresActive On
            ExpiresDefault "access plus 1 day"
        </FilesMatch>
    </IfModule>
    
    
     <IfModule mod2_2_cognos.c>
        CGIBinDir "/opt/IBM/cognos/analytics/cgi-bin"
     </IfModule>
    
    
    <Directory /opt/IBM/cognos/analytics>
        <IfModule mod_deflate>
            AddOutputFilterByType DEFLATE text/html application/json text/css 
            application/javascript
        </IfModule>
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    
    
    
    #Set up a cluster for load-balancing
    # Include all Cognos Analytics servers that have the Application server components 
    # installed and configured.
    # Important: do not include Cognos Analytics servers that are used to run the 
    # Content Manager service.
    <Proxy balancer://mycluster>
        BalancerMember http://ca-host1:9300 route=1
        BalancerMember http://ca-host2:9300 route=2
        BalancerMember http://ca-host3:9300 route=3
    </Proxy>
    
    # UI to monitor/configure load balancer
    <Location /ibmcognos/balancer-manager>
        SetHandler balancer-manager
    </Location>
    
    
    # Use ScriptAlias if you plan to use  cognos.cgi  instead of mod_cognos for SSO
    ScriptAlias /ibmcognos/cgi-bin /opt/IBM/cognos/analytics/cgi-bin
    
    Alias /ibmcognos /opt/IBM/cognos/analytics/webcontent
    
    RewriteEngine On
    
    # Send default URL to service
    RewriteRule ^/ibmcognos/bi/$ balancer://mycluster/bi/ [P]
    
    # Send login requests and legacy UI's through  cognos_module  for SSO
    RewriteRule ^/ibmcognos/bi/v1/(login|disp)(/.*)? 
        /ibmcognos/sso/bi/v1/$1$2 [PT,L]
    
    #Or Send login requests and legacy UI's through  cognos.cgi  for SSO
    RewriteRule ^/ibmcognos/bi/v1/(login|disp)(/.*)? 
        /ibmcognos/bi/v1/disp/bi/v1/$1$2 [PT,L]
    
    
    # Rewrite Event Studio static references
    RewriteCond %{HTTP_REFERER} v1/disp [NC]
    RewriteRule ^/ibmcognos/bi/(ags|cr1|prompting|ccl|common|skins|ps)/(.*) 
        /ibmcognos/$1/$2 [PT,L]
    
    # Rewrite Saved-Output and Viewer static references
    RewriteRule ^/ibmcognos/bi/rv/(.*)$ /ibmcognos/rv/$1 [PT,L]
    
    # Define cognos location
    <Location /ibmcognos>
        RequestHeader set X-BI-PATH /ibmcognos/bi/v1
    </Location>
    
    # Route CA REST service requests through proxy with load balancing
    <Location /ibmcognos/bi/v1>
        Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; 
        path=/ibmcognos/bi/v1"
        env=BALANCER_ROUTE_CHANGED
        ProxyPass balancer://mycluster/bi/v1 stickysession=ROUTEID
    </Location>
    
    # Route login and legacy UI requests through  mod_cognos 
    <Location /ibmcognos/sso>
        SetHandler cognos-handler  
        # Add SSO Directives here, for example... 
        AuthType basic
        AuthName "LDAP"
        AuthBasicProvider ldap
        AuthLDAPURL "ldap://ldap:389/ou=people, o=example.com?uid?sub?(objectClass=*)" 
        
        Require valid-user
    </Location>
    
    
    # This is an example only.
    # For more information about the apache directives that can be used
    # see http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html
    # Route login and legacy UI requests through  cognos.cgi 
    <Location /ibmcognos/cgi-bin>
        # Add SSO Directives here, for example...
        AuthType basic
        AuthName "LDAP"
        AuthBasicProvider ldap
        AuthLDAPURL "ldap://ldap:389/ou=people, o=example.com?uid?sub?(objectClass=*)" 
    
        Require valid-user
    </Location>
    
  3. If you are using IBM HTTP Server 8.5, change the following line in cognos.conf:
    LoadModule proxy_balancer_module modules/WebSphereCE/mod_proxy_balancer.so 
  4. Save the cognos.conf file.
  5. Restart the server.