Point-and-Run Framework: Running Applications Built for Other Web Servers The Point-and-Run framework in Pramati Server 3.5 makes it possible to serve an application running on another application server or web server environment without migrating, changing or moving the application files. Pramati Server is configured automatically to the application requirement. All equivalent tuning and runtime parameters are setup on the Server. The configuration in the source environment, including datasources, users, and security roles is replicated in Server. The Pramati Deployment Service framework that is part of the core Services Framework of Pramati Server provides all the required handling for Point-and-Run. What can you run on Server In general, Pramati Server can run the following types of applications: - Standard J2EE archive with Pramati deployment XMLs
- Standard J2EE archive with deployment XMLs of another vendor
- Exploded WARs (web applications)
- Application running on another application or web server. This is the Point-and-Run scenario, where an application running on another server environment can easily run on Server, without any intervention.
How to point-and-run To point-and-run an application, you only need to specify: - Source environment type (as Tomcat, ServletExec, Weblogic, or other servers)
- Source server directory
The Point-and-Run framework does all the necessary processing to run the application on Server. The application files are accessed from the source server directory without copying or modifying them. Point-and-Run framework Point-and-Run framework plugs into the PDS, which is the core for all deployment operations. PDS generates the required structures Pramati application objects that the containers process to serve the application. PDS allows plugging in handlers for various application types. Running a web application deployed on another server involves making the application data available to the deployed application and registering it with the PDS. The PDS is used for plugging in vendor specific handlers that create application objects. These application objects contain information about: - Location of the content to be served
- Compiled servlet classes
- Helper and library JARs
- Deployment descriptor for web.xml
The handler creates the application object and sets up server configuration, including datasources, other required resources, and security roles. How Point-and-Run is processed The Point-and-Run process is triggered by the deployer and one of the following detail is provided: - Install directory of the source server. Point-and-Run picks up the server configuration information and configures Server. The list of applications are picked up and the application is run
- Location of the application. Server configuration is not changed, but the setup required for application to run on Server is configured
Configuring an application This refers to setting application specific configuration on the source server. It involves resolving references such as, resource references and security roles. A web server has its own environment set up for the web applications deployed on it, apart from the configuration mandated by the specifications. Resolution of resources or references All resources or references required by the application must be resolved and bundled in Server specific deployment descriptors. References are resolved as per the servlet specifications. The following type of references are resolved: - Resource references
- Security role references
- Environment entries
- Pramati specific deployment information
To Point-and-Run an application, a working dataset is required within Server. This dataset includes the specific deployment descriptor for the application and location for keeping compiled servlet-classes. When an application is ported to Server, it creates the following dataset configuration and repository: - pramati-j2ee-server.xml
- WEB-INF\classes
Configuring Server Configuring Server involves setting up an environment similar to the source server. This includes configuring tuning parameters such as worker threads count and connection timeout parameters. Usage of Point-and-Run The user has an option to use Point-and-Run by specifying one of the following: - Serve the application without changing Server configuration
- Serve the application after configuring Server according to the source server
- Web applications deployed on Tomcat server can be run from Server from the Server shell.
Point-and-Run for Tomcat Running web applications deployed on Tomcat server involves making application data available with Tomcat and configuring the same on Pramati Server. On providing the location of the files and the Pramati Deployment Service accordingly reconfigures the Server. Tomcat configuration for web applications Pramati Deployment Service supports Point-and-Run for Tomcat Version 4.0 and higher. Configuration information of applications deployed in Tomcat is present in server.xml located in >TOMCAT_HOME>/conf/server.xml. Configuration information includes information on virtual host, resource configuration, and security configuration. Virtual host information An application can be served from a virtual host by dropping the application content into the document root of the virtual host. The document root is configured in the server.xml under the tag >Host<. Resource configuration Resource configuration used by the application is present in the server.xml under the tag >Resource<. Tomcat supports resources of type datasource and mail resource. References for the resources used by the Tomcat applications are specified in the web.xml as per the servlet specification. Security configuration Security configuartion information is specified in the tomcat-users.xml located in the >TOMCAT_HOME>/conf/tomcat-users.xml. This file consists of the user names, passwords, and the fields a user can participate in. Server configuration processed for Tomcat The Server configuration information can be processed from Tomcat environment. Tomcat configuration is setup in the server.xml file located at >TOMCAT_HOME>/conf/. Information about users is defined in tomcat-users.xml located at >TOMCAT_HOME>/conf/. From the server.xml, the following information is read and setup on Pramati Server: - Service
- MaxProcessors: Maximum number of request processing worker threads
- ConnectionTimeout: Timeout interval for the request after the connection
- Host
- Name: Virtual host name
- AppBase: Document root directory for virtual host
- Context: This includes information on Resources that will be needed by the application, including configuration mandated by the specification for application such as resources (JDBC and mail resources), security roles, environment entries.
Attributes and parameters used to Point-and-Run an application The attributes and parameters used to Point-and-Run applications running on Tomcat can be summarised as: - Configuring datasources
- Limitations: Driver classes should be placed in the server classpath. Resources which are defined in >Context< can not be overridden by >DefaultContext<
- Setting up security information
- Users
- Roles
- Resolution
- Complete Point-and-Run
Currently, for complete Point-and-Run of Tomcat, only applications which are present in server.xml are considered. Applications with empty Context Path can not be setup. Also, the following features cannot be configured to Point-and-Run Tomcat applications: EJB references and Server-defined environment entries Point-and-Run for Apache/Tomcat server Tomcat applications can be run by an Apache-Tomcat Engine, where the Apache server serves as the web-server redirecting the JSP requests to the embedded Tomcat Server. It is transparent. Apache server can redirect the requests to Tomcat for serving JSPs through plug-ins. Mod_jk is a plug-in for Apache to redirect JSP requests to Tomcat Server. JK is a module for Apache and its configuration is specified in the httpd.conf file under Apache's configuration directory. The Apache-Tomcat Point-and-Run allows just specifying Apache directory and the server configuration. All details and applications are picked up and served in Server. Tomcat application information can be specified in the mod jk plug-in configuration in two ways. - Include Directive: With include directive, Apache configuration can point to another configuration file. This directive takes a path where the configuration files reside. This configuration file contains the Tomcat aliases or contexts that are served from Apache.
- IfModule Directive: With IfModule Directive, configuration information can be specified for a particular module. For mod_jk module, this directive contains the information of Tomcat aliases or contexts that are served from Apache using the mod jk plug-in.
Server configuration Apache server configuration is specified in APACHE_HOME\conf\httpd.conf file in Apache specific format. Apache has directives that represent different types of configuration. The following directives are setup for Pramati Web Server at different levels of their appearance in the configuration file. | Apache Directives for Point-and-Run Directives | | Options | Description | | DocumentRoot | Root directory from which files are served. | | Alias | This directive allows documents to be stored in the local file system other than the documentRoot. | | ErrorDocument | In the event of any problem or error, this directive allows to configure HTTP error codes to a particular action such as displaying an error message, an error document within the local system, or an error document by redirecting to another URL. | | Directory Index | This directive sets the list of resources to look for, when the client requests an index of the directory by specifying a '/' at the end of the directory name. | | Directory | This directive encloses a group of directives which will apply only to the named directory and sub-directories of that directory. | | Options | This directive controls which server features are available for a particular directory. | | Virtual Host | This directive enclose a group of directives which will apply only to a particular virtual host. | | Socket Property Directives/KeepAlive | Provide long HTTP sessions which allow multiple client requests to be sent over the same TCP connection. | | Socket Property Directives/KeepAliveTimeout | The number of seconds web-server will wait for a subsequent request before closing the connection. | | Tomcat Plug-in configuration | Reference to the Tomcat configuration XML- located through the Tomcat application alias |
|