Docstoc

Configuring a Tomcat Container for SESM

Document Sample
Configuring a Tomcat Container for SESM Powered By Docstoc
					                                                                                A P P E N D I X                          C
              Configuring a Tomcat Container for SESM

              This chapter contains the following topics:
               •     J2EE Containers, page C-1
               •     Creating WAR Files for Containers Other Than Jetty, page C-1
               •     Configuring a Tomcat Container, page C-2



J2EE Containers
              SESM web applications are J2EE web applications. They must run in a J2EE web server. The web server
              is the container for the applications that run in it. The SESM installation program installs and configures
              Jetty servers as the containers for the SESM web applications. You can create a web archive (WAR) file
              from the installation directory and deploy SESM web applications in other containers.

              Container Requirement for the Port-Bundle Host Key Feature
              Before you deploy SESM applications in containers other than Jetty, determine if your solution requires
              the port-bundle host key feature on the Service Selection Gateway (SSG). For solutions that use SSG,
              we recommend enabling the port-bundle host key feature.


              Note      The Jetty server is currently the only J2EE-compliant server that can support the port-bundle
                        host key feature.



Creating WAR Files for Containers Other Than Jetty
              You can create web archive (WAR) files to use in deploying the SESM web applications in non-Jetty web
              containers. To create a WAR file, use the jar command on the webapps directory under the desired SESM
              web application. For example, to create a WAR file for NWSP on a Solaris system, enter the following
              commands:
              cd installDir/nwsp/webapp
              jar cvf ../nwsp.war *




                                         Cisco Subscriber Edge Services Manager Administration and Configuration Guide
 OL-5366-01                                                                                                              C-1
                                                                                            Appendix C   Configuring a Tomcat Container for SESM
 Configuring a Tomcat Container




                       For instructions about deploying an application using a WAR file, see the documentation for the
                       container you are using. Also, consider the following points:
                        •   The installed configuration is specific to a Jetty container. If you choose to deploy the SESM web
                            applications in a container other than Jetty, you must make changes to the container MBeans. For
                            example, you must change class or object names. You might need to add MBeans.
                        •   Web containers might use their own JSP engine, so the installed precompiled JSPs for the SESM
                            web applications cannot be used.



Configuring a Tomcat Container
                       This section describes how to use an installed SESM web application in a Tomcat container from the
                       Apache Software Foundation. Tomcat is the servlet container used in the official reference
                       implementation for the Java servlet and JavaServer Pages technologies, developed by Sun under the Java
                       Community Process. For more information and to obtain the Apache Tomcat software, see:
                       http://jakarta.apache.org/tomcat/
                       The recommended release for use is Tomcat 4.1.27.


             Note      This release of SESM does not work with Tomcat 5.x. SESM uses the Servlet 2.3 and JSP1.2 APIs, while
                       Tomcat 5.x implements the Servlet 2.4 and JSP2.0 specifications.

                       The following procedure describes configuring a Tomcat container for the NWSP web portal application.
                       You must configure a Tomcat container for each web application required.


            Step 1     Install Tomcat from the following location.
                            http://jakarta.apache.org/tomcat

            Step 2     Install SESM and a JDK, as described in the Cisco Subscriber Edge Services Manager Installation
                       Guide.
            Step 3     Using the jar command from the previously installed JDK, create a ROOT.war file from NWSP.
                            cd $SESM/nwsp/webapp
                            jar cvf ../ROOT.war *

            Step 4     Go to the Tomcat home directory.
                            cd $CATALINA_HOME

            Step 5     Remove (rename) the Tomcat default ROOT directory in webapp.
                            mv webapps/ROOT webapps/ROOTorig

            Step 6     Make the NWSP the default webapp.
                            cp $SESM/nwsp/ROOT.war webapps

            Step 7     Make an NWSP home directory for config and logs.
                            mkdir nwsp

            Step 8     Make a NWSP log directory.
                            mkdir nwsp/logs




            Cisco Subscriber Edge Services Manager Administration and Configuration Guide
 C-2                                                                                                                                 OL-5366-01
Appendix C   Configuring a Tomcat Container for SESM
                                                                                                                 Configuring a Tomcat Container




             Step 9    Copy the nwsp configuration directory from the SESM directory into the tomcat directory.
                             cp -r $SESM/nwsp/config nwsp

             Step 10   Add the permissions required for SESM to run as a ROOT web application.
                        c.   Go to $CATALINA_HOME.
                        d.   Edit the conf/catalina.policy file.
                        e.   Add the following section, which gives permission for SESM applications to run as ROOT web
                             applications.
                                    // Permissions required for SESM running as ROOT web application
                                    grant codeBase "file:${catalina.home}/webapps/ROOT/WEB-INF/-" {
                                    //permission java.security.AllPermission;
                                    permission java.net.SocketPermission "*",
                                    "accept,connect,listen,resolve";
                                    permission java.io.FilePermission "/-", "read,write,delete";
                                    };
             Step 11   Increase the heap sizes reserved for Tomcat. The heap size is taken from the environment variable, so at
                       the terminal, enter:
                             setenv JAVA_OPTS="-Xms64m -Xmx64m"

             Step 12   Unpack the WAR file:
                        a.   Run Tomcat:
                             bin/startup.sh

                        b.   Verify that the ROOT directory has been created in $CATALINA_HOME/webapps
                        c.   Stop Tomcat
                             bin/shutdown.sh



                             Note      These instructions assume that the WAR file is unpacked, which is the default setting in a
                                       Tomcat installation. To check the setting, find the following lines in conf/server.xml:

                                       <!-- Define the default virtual host -->
                                       <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">



             Step 13   Add the general and SESM libraries common to all applications (this list can be verified by checking the
                       class path in jetty/bin/start.sh):
                             cp   $SESM/libs/jmx/lib/com.cisco.sesm.jmx.jar common/lib
                             cp   $SESM/libs/logging/lib/com.cisco.sesm.logging.jar common/lib
                             cp   $SESM/redist/jaxp/lib/xalan.jar common/lib
                             cp   $SESM/redist/jce/lib/* common/lib
                             cp   $SESM/redist/jmx/lib/* common/lib
                             cp   $SESM/redist/mx4j/lib/* common/lib

             Step 14   To ensure that the web application uses the same logging library as configured and used by the MBeans,
                       remove the local library:
                             rm $CATALINA_HOME/webapps/ROOT/WEB_INF/lib/com.cisco.sesm.logging.jar




                                                       Cisco Subscriber Edge Services Manager Administration and Configuration Guide
OL-5366-01                                                                                                                                 C-3
                                                                                           Appendix C   Configuring a Tomcat Container for SESM
Configuring a Tomcat Container




                      Note        The NWSP class loader diverges from the default Java 2 delegation model, in accordance with
                                  the servlet specification, version 2.3. Unlike Jetty, it is not possible to configure Tomcat to
                                  follow the Java 2 or the servlet 2.3 delegation model. So when a request to load a class from the
                                  NWSP class loader is processed, this class loader will look in the local repositories first, instead
                                  of delegating before looking.

           Step 15    In webapps/ROOT/WEB_INF/web.xml, edit the initParam for application.home of MainServlet. The
                      value provided should be the absolute path of the NWSP home directory for config and logs.
                      For example:
                             <init-param>
                             <param-name>application.home</param-name>
                             <param-value>D:\Tomcat4.0.6\nwsp</param-value>
                             </init-param>

           Step 16    (Optional) If running Tomcat from $CATALINA_HOME using bin/startup.sh, then the DESS log is
                      placed in $CATALINA_HOME/logs. To change this log file location to be in a different directory, edit
                      nwsp/config/dessauth.xml. Change the relative path for the DESS log to an absolute path. For example,
                      the following change places the log in nwsp\logs under the Tomcat directory:
                             <Set name="traceFileName">D:\Tomcat4.0.6\nwsp\logs\dess.log</Set>

           Step 17    (Optional) You do not have to install the SESM application into webapps/ROOT. You can change the
                      application’s default context by modifying conf/server.xml.
                      For example, to use webapps/nwsp rather than webapps/ROOT, follow these steps:
                       a.    Edit conf/server.xml.
                       b.    Find this line:
                                    <!-- Tomcat Root Context -->

                             and uncomment the following line.
                       c.    Change:
                             <Context path="" docBase="ROOT" debug="0"/>

                             to
                             <Context path="" docBase="nwsp" debug="0"/>
           Step 18    Run Tomcat.
                             bin/startup.sh



                             Note     If only nwsp.war exists at this stage, then the nwsp directory structure is unpacked, but an
                                      exception occurs because the nwsp directory did not initially exist. In that case, restart
                                      Tomcat and the application will run.

                      This completes configuration for Tomcat 4.0. If you are configuring Tomcat 4.1.x, continue with the
                      following steps.


                      Note        An unmodified Tomcat 4.1 installation does not work with a SESM WAR file.




           Cisco Subscriber Edge Services Manager Administration and Configuration Guide
C-4                                                                                                                                 OL-5366-01
Appendix C   Configuring a Tomcat Container for SESM
                                                                                                                 Configuring a Tomcat Container




             Step 19   Disable Tomcat 4.1 JMX MBeans support. Edit conf/server.xml, search for the following lines and
                       comment them out (using <!-- and -->):
                              <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"debug="0"/>
                              <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
                              debug="0"/>


                       Note      Tomcat 4.1 MBeans support should be disabled, as no default domain has been specified. Many
                                 SESM MBeans are instantiated using the appropriate tags in the container-independent
                                 configuration. However, certain mechanisms such as that for extensions require self-registering
                                 MBeans. For these, SESM requires a default domain of "com.cisco.sesm". This is satisfied as
                                 long as the MBeanServer is not instantiated by the Tomcat container rather than by the SESM
                                 web application.

             Step 20   Enable access (request) logs [optional]. Edit conf/server.xml, search for the following tag and
                       uncomment it (by removing <!-- and -->):
                              <Valve className="org.apache.catalina.valves.AccessLogValve "directory="logs"
                              prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>


                       Note      Tomcat 4.1 has access logging disabled by default.

             Step 21   Enable servlet invocation. Edit conf/web.xml, search for the following lines and uncomment them (by
                       removing <!-- and -->):
                              <servlet-mapping>
                                  <servlet-name>invoker</servlet-name>
                                  <url-pattern>/servlet/*</url-pattern>
                              </servlet-mapping>


                       Note      Tomcat 4.1 has the mapping for the invoker servlet removed by default.

             Step 22   Tomcat 4.1 uses Jasper 2. The precompiled JSPs in NWSP were produced with Jasper 1. The
                       recommended modification is to follow the instructions in the Tomcat 4.1 release note for using Jasper 1.
                       That is, copy the following Tomcat 4.0.6 files into $CATALINA_HOME/common/lib:
                              $TOMCAT40x_HOME/lib/jasper-runtime.jar
                              $TOMCAT40x_HOME/lib/jasper-compiler.jar



                       Note      An alternative approach is to compile the JSPs at run time, as described in the Cisco Subscriber
                                 Edge Services Manager Web Developer Guide. In summary, copy web.recompile.xml and
                                 web.xml, and restart the server.

                                 However, this last approach may require changes to the TLD descriptors in
                                 nwsp/webapp/WEB-INF or to the way the tags are used in the JSPs. The TLDs conform to the
                                 ordering of tags as given in the DTD for JSP 1.2 Tag Library Descriptors. They do not as yet
                                 include any optional information to validate the conformance of the JSP pages to using this tag
                                 library (javax.servlet.jsp.tagext.TagLibraryValidator). Jasper 1 in Tomcat 4.0 version does not
                                 validate, while Jasper 2 in Tomcat 4.1 does perform validations.




                                                       Cisco Subscriber Edge Services Manager Administration and Configuration Guide
OL-5366-01                                                                                                                                 C-5
                                                                                           Appendix C   Configuring a Tomcat Container for SESM
Configuring a Tomcat Container




           Cisco Subscriber Edge Services Manager Administration and Configuration Guide
C-6                                                                                                                                 OL-5366-01

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:3
posted:12/8/2011
language:English
pages:6