Skip to Content

BOE with Apache as a Web server and Cluster of Tomcat as a App  Server

This document would detail out the necessary implementation steps required for the Implementation of Apache as a Web server, Clustered Tomcats as a App server, BOE as the Central Processing server.

For the purpose of the entire landscape ,  I have consumed   Four  separate machines running the OS Windows 2008 SP2  64 Bit Edition with a hardware size of 16G Ram Quad core processors.

            

Machine

Machine Name

Purpose

Machine 1

V01874

Central BOE   Installation server

Machine 2

V01513

Apache  as a Web server Installation

Machine 3

V01289

Tomcat as a app   server Installation (Tomcat Cluster 1)

Machine 4

V02000

Tomcat as a app server   Installation (Tomcat Cluster 2)

The whole of this document is divided into Four milestones

MileStone 1 : Ensuring the Apache and Tomcat machine Connection successful

MileStone 2 :Deployment  of BOE web content : Static Content into Apache and Dynamic content  into Tomcat and their respective configurations.

MileStone 3 :Clustering of Tomcats so that Load balancing and Failover scenarios for Tomcat as an App server can be taken care .

MileStone 4 :  Performance Analysis of Apache

Milestone 1 :  Apache and Tomcat Handshake

Apache  Web server Set UP

Downloads Required

1.       Download the compiled Apache binaries from Apache Lounge here: www.apachelounge.com/download/

a.        At the time of documenting, the build I ‘m  consuming is httpd-2.4.10-win64-VC11.zip

2.       Also download the module packages from Apache Lounge because we will require mod_jk module

           At the time of writing it is Modules-2.4-win64-VC11.zip

3.      Be sure that you have installed Visual C++ Redistributable for Visual Studio 2012. The Apache Lounge Web site has a link to this:

                        At the time of writing it is VC11 vcredist_x64/86.exe

Install and Start Apache HTTP Server 2.4

1.       Unzip the Apache zip file to a folder. C:\Apache24

2.       This is the default server root in Apache httpd.conf. If you wish to change the install directory, you will also need to change the ServerRoot and DocumentRootparameters specified in httpd.conf under folder \Apache24\conf\

3.       Find mod_jk.so from the downloaded Apache module package and place it under the folder C:\Apache24\modules

4.       Edit the httpd.conf file, and specify values for the following parameters

           Listen 80

           ServerName localhost

           ServerAdmin youradminaddress@company.com

5.       Disable IIS if it is installed on the machine. If you wish to leave IIS running, you’ll have to manage which server responds to port 80.

6.       Start Apache httpd from command prompt (Start run cmd), and install as a service

cd C:\Apache24\bin\

httpd.exe -k install

Test the installation of Apache httpd by launching a browser and typing the URL: http://localhost. You should get a page saying “It works”. Here you have successfully installed Apace HTTP Server 2.4

Install The Apache Tomcat as an App Server: (V01289)

1.       Download Apache Tomcat from the tomcat website,  I have used apache-tomcat-7.0.54.exe

2.       Go to Configure Tomcat Option->Java and add the below snippet for the java Options

Dcatalina.home=C:\Tomcat7

Dcatalina.base=C:\Tomcat7

Djava.endorsed.dirs=C:\Tomcat7\endorsed

Djava.io.tmpdir=C:\Tomcat7\temp

-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

-Djava.util.logging.config.file=C:\Tomcat7\conf\logging.properties

XX:PermSize=256m

XX:MaxPermSize=256m

XX:NewSize=171m

XX:MaxNewSize=171m

XX:SurvivorRatio=2

XX:TargetSurvivorRatio=90

-XX:+DisableExplicitGC

-XX:+UseTLAB

3. Change the Initial memory pool and Maximum memory pool to 1024 MB.

4. Restart Tomcat.

Now Switch to the Machine (V01513)where Apache is Installed

1.     Download the Apache-Tomcat Connector Module. ( Download Tomcat Connectors JK 1.2 JK 1.2 Binary Releases win32 jk-1.2.xx mod_jk-1.2.xx-httpd-2.2.x.so“).

2.     Rename the downloaded module to “mod_jk.so” and move into directory “c:\Apache24 \modules“.   (The modules folder where apache  is installed)

3.     Configure Apache – We need to configure the Apache HTTP Server to load and initialize the JK module.

4.     Create a configuration file called “mod_jk.conf” as follows and place it in “c:\Apache24\conf“:

mod_jk.conf

# Load mod_jk module

# Update this path to match your modules location

LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties

# Update this path to match your confdirectory location

JkWorkersFile conf/workers.properties

# Where to put jk logs

# Update this path to match your logs directory location

JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]

JkLogLevel info

# Select the log format

JkLogStampFormat “[%a %b %d %H:%M:%S %Y]”

# JkOptions indicate to send SSL KEY SIZE,

JkOptions +ForwardKeySize +ForwardURICompatForwardDirectories

# JkRequestLogFormat set the request format

JkRequestLogFormat “%w %V %T”

# Send everything for context /ws to worker ajp13

JkMount /ws ajp13

JkMount /ws/* ajp13

# Send everything for context /examples to worker ajp13

JkMount /examples ajp13

JkMount /examples/* ajp13

JkMount /docs/* ajp13

5.     The contents of the mod_jk.conf is attached with this document

6.     Create the “workers.properties” file and place it in ” c:\Apache24\conf ” as follows:

Worker.properties

# Define 1 real worker named ajp13

worker.list=tomcatlb  // Worker name

# Set properties for worker named ajp13 to use ajp13 protocol,

# and run on port 8009

#connecting port type, which needs to be same in tomcat connector in server.xml

worker. tomcatlb  .type=ajp13 worker. tomcatlb  .host=v01289.dhcp.pgdev.sap.corp

worker. tomcatlb  .port=8009

worker. tomcatlb  .lbfactor=50

7.     Configure Tomcat – The default configuration in Tomcat’s “conf\server.xml” starts the AJP1.3 service via the following configuration, on TCP port 8009 (remove the comments if these lines are commented out).

<!– Define an AJP 1.3 Connector on port 8009 –>

<Connector port=”8009″ enableLookups=”false” redirectPort=”8443″ protocol=”AJP/1.3″ />

8.     Finally, Go to httpd.conf file and add the following below line:

Include conf/mod_jk.conf

9.     Restart Apache and load http://localhost/examples/ , You should see the  examples getting loaded from the Tomcat Machine from apache.

With this, we can be rest assured that the Connection between Apache and Tomcat is seamless.

Now next, we  need to configure apache and tomcat in a more custom manner  for the configuration file so that it is BOE specific so that   post wdeploy, tomcat fetches the details from the BOE and the  apache talks to tomcat to fetch these details.

Once successful, comment the included line in the httpd.conf

Include conf/mod_jk.conf  

Milestone 2 : Deploying the BOE static content in Apache web server and Dynamic files into Tomcat and making up and running the entire BOE set up via Apache as the Entry point

BOE Specific Apache Configuration:

1.      Download the attached file httpd-bi41.conf  and place it in the

in folder C:\Apache24\conf\extra

httpd-bi41.conf

#====================LoadModules======================

LoadModule jk_module modules/mod_jk.so

LoadModule headers_modulemodules/mod_headers.so

LoadModule deflate_modulemodules/mod_deflate.so

LoadModule cache_modulemodules/mod_cache.so

LoadModule cache_disk_modulemodules/mod_cache_disk.so

#====================Configure mod_jk==============

# Where to find workers.properties

# Update this path to match your confdirectory location (put workers.properties

#next to httpd.conf)

JkWorkersFile conf/workers.properties

# Where to put jk shared memory

# Write shared memory to the logs directory

JkShmFile logs/mod_jk.shm

# Where to put jk logs

# Update this path to match your logs directory location (put mod_jk.log next to

#access_log)

JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]

JkLogLevel    info

# Select the timestamp log format

JkLogStampFormat “[%a %b %d %H:%M:%S %Y]”

#====================Configure mod_headers==============

FileETag None

Header unset ETag

   <FilesMatch“\.(gif|jpe?g|png|html?|js|css)$”>       

                Header set Cache-Control “public, max-age=315360000”   

   </FilesMatch>

#====================Configure mod_deflate==============

SetOutputFilter DEFLATE

#Highest 9 – Lowest 1

DeflateCompressionLevel 9

# Don’t compress images

SetEnvIfNoCase Request_URI\

\.(?:gif|jpe?g|png)$ no-gzipdont-vary

#Optional

#Logging

DeflateFilterNote ratio

LogFormat ‘”%r” %b (%{ratio}n) “%{User-agent}i“‘ deflate

CustomLog logs/deflate_log.log deflate

#====================Configure mod_cache==============

<IfModule mod_cache.c>

#Address the Thundering Herd identified in Apache’s Caching Guide

CacheLock on

CacheLockPath C:/temp/mod_cache-lock

CacheRoot C:/cacheroot

CacheLockMaxAge 5

#This parameter tells Apache to ignore unique session identifiers when caching

#static content.  SAP BI Platform 4.0 uses the strings jsessionid and bttoken to

#identify user sessions.

CacheIgnoreURLSessionIdentifiers jsessionidbttoken

#Don’t cache cookies as they are unique per user

CacheIgnoreHeaders Set-Cookie

#Enable mod_disk_cache instead of mod_mem_cache

<IfModule mod_cache_disk.c>

CacheRoot C:/cacheroot

CacheEnable disk /

CacheDirLevels 2

CacheDirLength 1

</IfModule>

</IfModule>

#====================End httpd-BI40.conf==============

2.       Include this line in the last in httpd.conf:

3.       Include conf/extra/httpd-bi41.conf

Wdeploy Settings  inCentral BOE Installation Machine

1. Go to <Install_Dir>\SAP BusinessObjects Enterprise XI 4.0\wdeploy\conf

2. Open config.Apache

Change the following according to the screenshot provided below

è Ws_dir = <WebServer_Install_dir>

è Deplyment_dir=<WebServer_Install_dir>\htdocs

è Plugin_install=<WebServer_Install_dir>\plugins

          /wp-content/uploads/2015/12/111_847577.jpg              

3. Save and exit

4. Go to <Install_Dir>\SAP BusinessObjects Enterprise XI 4.0\wdeploy\conf

5. Open config.Tomcat7 and change the following

    as_dir=<Path where Tomcat is installed>\Tomcat7

  As_instance = localhost

/wp-content/uploads/2015/12/112_847578.jpg

Deployment UsingwDeploy command line tool:

1.       Open command prompt andGo to the following path.

2.       <Install_dir>\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\Wdeploy

3.       Run the following command :

wdeploy.bat Tomcat7 –Das_mode=split –Dws_type=apache predeployall

4.       This would  help in segregating the static content and dynamic content required for the Apache and Tomcat separately.

5.       Once  this is done, You will get as build successful, refer the below screenshot how it would look like.

/wp-content/uploads/2015/12/113_847579.png

6.      

7.       Ensure over the network that the Apache24 in the apache machine and the Tomcat7 folder under  Tomcatmachine is accessible to the Central BOE machine, else share the folder for the Windows AD account name  in these machine names from the Windows Ad Login BOE is getting accessed.

8.       Now, we are ready to  do the actual deployment , again in the same level in the command prompt, run the following command :

wdeploy.bat Tomcat7 –Das_mode=split –Dws_type=apache deployonlyall

9.       After wdeploy  step is done, all the BOE specific  configuration files which are copied into the apache conf folder ,  the updated path seems to be incorrect with //….

It needs to be changed with absolute path for the Apache24 folder

10.   Open Browser in Apache Machine Launch http://localhost/BOE/Bi from and you should be seeing the  BOElaunch Pad. The same can be accessed from the IP address of the Apache machine

11.   If authentication is not appearing in the BI Launchpad, Go to Tomcat->Webapps->BOE->BILaunchpad.propertiesand enable authentication.visible=true

# Choose whether to let the user change the authentication type.  If it isn’t shown the default authentication type from above will be used

authentication.visible=true

Milestone 3 : To set up two  nodes to Tomcat so that we  can do load balancing as well as failover scenario between the App server

Configuration required  in Apache Machine:

1.       Go to the Worker.properties and add the second tomcat node details with the lad balancing factors.

2.       Refer the below code for our  worker.propertiesfile with the new one.

Worker.properties

worker.list=tomcatlb,stat

# Set properties for worker named cluster1 to use ajp13 protocol,

# and run on port 8009

worker.cluster1.type=ajp13

worker.cluster1.host=v01289.dhcp.pgdev.sap.corp

worker.cluster1.port=8009

worker.cluster1.lbfactor=50

# Set properties for worker named cluster2 to use ajp13 protocol,

# and run on port 8009

worker.cluster2.type=ajp13

worker.cluster2.host=v02000.dhcp.pgdev.sap.corp

worker.cluster2.port=8009

worker.cluster2.lbfactor=50

#Load Balance Worker Configuration

worker.tomcatlb.type=lb

worker.tomcatlb.balance_workers=cluster1,cluster2

worker.list=jkstatus

worker.jkstatus.type=status

Configuration required in Tomcat  Machine:

1.       Go to the each of the Tomcat Machines server.xml file and add the jvmroute parameter for the worker name which is defined for the node in the  ApacheMachine worker.properties.

2.       In my case, the two nodes names defined in the worker.propertiesfor Apache is cluster1 and cluster2 .

3.       Add in the below snippet of code

<Engine name=”Catalina” defaultHost=”localhost jvmRoute=”[worker name]”>

MileStone 4 :  Performance Analysis of Apache

1.       In the Apache Machine, Go to worker.properties file and in the end of the file , Include the line

worker.stat.type=status

2.       Go to httpd.conf file and add the following line of code:

JkMount / balancer

JkMount /status   stat

Final Architecture after the Setup :

114.PNG

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply