CONTENTS   NextPrevious  



How to Set up SAP J2EE Engine 6.20 Web Server

SAP J2EE Engine 6.20 can be used as a fully functional Web server. This is implemented in HTTP Service. This service can receive requests over the HTTP protocol from clients and respond to them by sending back the HTML files that correspond to the requested URL. It is a session service – that is, it is installed on both dispatcher and server nodes to process more client requests. HTTP Service is developed in accordance with HTTP 1.1 specification (RFC 2068).

SAP J2EE Engine 6.20 Web server supports high-volume Web sites consisting of static contents such as HTML and image files, and also Servlets and JavaServer Pages (JSP). To serve dynamic Web applications, SAP J2EE Engine 6.20 provides a Servlet_jsp Service that works as a container for Web applications’ Servlets. This service includes a JSP engine for processing JSP files. To perform these functions, Servlet_jsp Service fully implements Java TM Servlets 2.3 and JavaServer Pages TM 1.2 Specifications.

Note: Although you can use the Web server as your basic server, you are not forced to do so. Other configurations work together with your own Web server and the contents therein, including plugins provided with SAP J2EE Engine 6.20. However, it is worthwhile to compare all possibilities for performance reasons.

Setting Ports

HTTP Port

By default, the SAP J2EE Engine 6.20 Web server listens for HTTP requests on port 80. The system administrator can define another port value. If the new port value is already in use by another service, an error occurs. When the new port is set, the HTTP Service must be restarted.

To change the HTTP port, choose Dispatcher ® Services ® HTTP from the “Cluster” tree in the left-hand pane of Visual Administrator. Choose the “Properties” tab from the right-hand pane. Specify the HTTP port in the “Port” field. To save the changes, choose  (Save). You are then prompted to restart the HTTP Service. Choose “Yes” from the dialog box.

For the default port execute: http://yourhost

When a new port is specified, execute: http://yourhost:newportnumber

SSL Port

To provide privacy between two communicating applications (a client and a server) SAP J2EE Engine 6.20 Web server uses the Secure Sockets Layer (SSL) Protocol. This protocol is designed to authenticate the server, and optionally the client.

The advantage of SSL is that it is independent of the application protocol used. A “higher level” application protocol (for example, HTTP, FTP, TELNET, and so on) lies transparently on top of the SSL Protocol. The SSL Protocol can negotiate an encryption algorithm and session key as well as authenticate a server before the application protocol transmits or receives its first byte of data. All application protocol data is transmitted encrypted, ensuring privacy.

To change the SAP J2EE Engine 6.20 Web Server SSL port, choose the Dispatcher ® Services ® HTTP node from the “Cluster” tree in the left-hand pane of Visual Administrator. Choose the “Properties” tab from the right-hand pane. Specify the SSL port in the “SSL Port” field. To save the changes, choose  (Save Properties) on the toolbar. You are then prompted to restart the HTTP Service. Choose “Yes” from the dialog box.

Note: To enable SSL communication, copy the iaik_jsse.jar , iaik_ssl.jar , iaik_jce.jar packages into the following directories: ../admin/lib/ , ../alone/additional-lib/ , ../cluster/dispatcher/additional-lib/ , ../cluster/all dispatchers/additional-lib/ , ../cluster/server/additional-lib/ , and ../cluster/all servers/additional-lib/ , or at a location specified in the CLASSPATH system variable. The IAIK packages either can be obtained from the SAP J2EE Engine provider or can be downloaded at http://jcewww.iaik.at/download/evaluation/index.php . Start Keystore and SSL Services on both dispatcher and server nodes. Keystore Service must be started first.

Setting Various Virtual Hosts on One Server

Virtual hosting enables you to define host names to which servers or clusters respond. When you use virtual hosting, you use Domain Name System (DNS) to specify one or more host names that map to the SAP J2EE Engine 6.20 IP address, and you specify the Web Applications that are served by the virtual host.

Step 1 – Accessing the HTTP Service

To access your virtual host configuration properties choose Server ® Services ® HTTP from the “Cluster” tree in the left-hand pane of Visual Administrator. Choose “Runtime” from the right-hand pane. The default host is SAP J2EE Engine 6.20 Documentation Start Page. It is accessed by executing http://localhost/ in your Web browser.

To modify the default host, or to set SAP J2EE Engine 6.20 to respond to other virtual hosts, specify the Host Name, Root Directory, Start Page, or the Aliases (or both Start Page and Aliases).

Step 2 – Choosing the Host Name

To set a new host name, choose “Runtime” from the right-hand pane. Enter the name in the “Host name” field. You must also modify the hosts file in your operating system source directory (for example, C:\WINNT\system32\drivers\etc for WindowsNT). The server responds to the specified host name when executing HTTP requests.

Step 3 – Setting Your Root Directory

Enter the path to your Web application root directory in the “Root Directory” field. The path can be either absolute or relative (from the <SAPj2eeEngine_install_dir>/cluster/server directory).

Note: Specifying the root directory in SAP J2EE Engine 6.20 Visual Administrator does not create this directory automatically.

When you complete Step 3, choose “Add” in the “Hosts” pane. To modify the properties of a virtual host, choose “Set” in the “Hosts” pane. Restart the HTTP Service.

Completing Steps 1, 2, and 3 is enough to run your Web application. Completing Step 4 is necessary if your Start Page does not meet the file name and format requirements specified by the “Infer Names” pane in the Properties ® General tab.

Step 4 – Start Page

Choose “Runtime” from the right-hand pane. Specify the path to your Web application start page in the “Start Page” field. The path can be relative (from the specified root directory) or absolute. Choose “Set” in the “Hosts” pane. Restart the HTTP Service.

Setting this property is optional. It is required only if the Web application start page name or type (or both) differs from the file types specified in the “Infer Names” pane in the Properties ® General tab, or the start page is not located in the specified root directory.

When starting the Web application, the server searches for the files defined in the “Infer Names” pane in their order of appearance. Therefore, the order of these files is important and can be changed by using the options on the right-hand side to best suit your application.

Step 5 – Setting Aliases

The use of aliases in SAP J2EE Engine 6.20 HTTP Service enables one object to be named using different names. You can set a leaf entry to point to another object in the namespace. Called an alias entry, it contains the name of the object to which it is pointing. When you look up an object by using the alias, the alias is dereferenced so that what is returned is the object pointed to by the alias name.

To set aliases, choose the Server ® Services ® HTTP node from the “Cluster” tree in the left-hand pane of Visual Administrator. Choose “Runtime” from the right-hand pane. Enter the name of the new alias in the “Alias” field. Point the path to the object’s file or directory (or both) in the “Path” field. Choose  “Add” to add the new alias. To access the object, execute http://yourhost/aliasname in your Web browser.

Note: When deploying Web applications on SAP J2EE Engine 6.20, they appear automatically as aliases to the default host. To set a deployed application to be available on other virtual host, add it as an alias to your virtual host.

Caching

Cache is the program’s local store for response messages and the subsystem that controls its message storage, retrieval, and deletion. A cache stores cacheable responses to reduce the response time and network bandwidth consumption for future, equivalent requests. Any client or server may include a cache, although a server cannot use a cache while it is acting as a tunnel. SAP J2EE Engine 6.20 HTTP Service provides options for administration of HTTP cache.

The  icon in the HTTP Service “Runtime” tab clears the HTTP cache in a runtime mode.

In the Properties ® General tab, there are three more options to administer the HTTP cache:

Mime Types

The Multipurpose Internet Mail Extensions (MIME) type specifies the data format. Some of the most common types of preformatted data used in SAP J2EE Engine 6.20 HTTP Service are: text data, page description language documents, image data, and autosense print data. This section describes each of these data types, lists their corresponding MIME types, and explains how to add additional MIME types or to modify the current ones using the SAP J2EE Engine 6.20 Visual Administrator.

Text Data

Typically, preformatted text data is provided in a character-oriented representation class, such as a character array, String, or Reader, or in a byte-oriented representation class, such as a byte array, input stream, or URL. Plain text and HTML are two common forms of preformatted text data. These MIME-type strings can be used to represent the format of the data when constructing a DocFlavor (i.e. print data format):

Page Description Language Documents

Typically, preformatted page description language (PDL) documents are provided in a byte-oriented representation class, such as byte array, InputStream, or URL. These MIME type strings can be used to represent the format of the data when constructing a DocFlavor:

Image Data

Preformatted image data is provided in a byte-oriented representation class: byte array, InputStream, or URL. You can use these MIME type strings to represent the format of the data when constructing a DocFlavor:

Autosense Print Data

Preformatted autosense print data enables the printer to decide how to interpret the print data. Typically, this type of data is provided in a byte-oriented representation class. The following MIME type string can be used to represent the format of the data when constructing a DocFlavor:

How to Add and Modify MIME Types

To add new MIME types, or to modify current ones, choose Server ® Services ® HTTP node from the “Cluster” tree in the left-hand pane of Visual Administrator. From the right-hand pane, choose Properties ® MIME Types . A list of file extensions and their MIME types appears. The SAP J2EE Engine 6.20 HTTP Service uses these file extensions by default.

Adding a New MIME Type

Enter the name of the file extension you want to add in the “Extension” field. Enter the MIME type that corresponds to this extension in the “MIME Type” field. Choose “Add” to add the new MIME type. To save the changes, choose  (Save Properties). The HTTP Service restarts to enable the changes to take effect.

Modifying the Current MIME Types

Select a file extension and its MIME type from the list of file extensions and MIME types in Properties ® MIME Types . Modify the MIME type properties in the “MIME Type” field. Choose “Add” to set the new MIME type properties for this file extension. To save the changes, choose  (Save Properties). The HTTP Service restarts to enable the changes to take effect.

Note: If you modify the file extension in the “Extension” field, SAP J2EE Engine 6.20 Visual Administrator creates a new file extension with the same MIME type properties.

Log Files

Dispatcher Node

The SAP J2EE Engine 6.20 HTTP Service log system is separated between the server and the dispatcher. HTTP Service on dispatcher node creates log messages in the <SAPj2eeEngine_install_dir>/cluster/dispatcher/services/log/work directory. These log files contain information about opening and closing HTTP and HTTPS sockets, about errors occurring when opening new sockets, and about changing HTTP and SSL port values. To view the dispatcher log messages, choose Server ® Services ® HTTP from the “Cluster” tree in the left-hand pane of Visual Administrator. Choose “Log Viewer” from the right-hand pane. All significant events that occur on the dispatcher node are written to log files that correspond to each module. Select the “Log type” dropdown menu on the toolbar to view all log messages.

Server Node

HTTP Service on server node creates log messages by default in the <SAPj2eeEngine_install_dir>/cluster/server/services/http/log directory. These log files record all significant events that have occurred on the HTTP Service.

Choose Server ® Services ® HTTP from the “Cluster” tree in the left-hand pane of Visual Administrator. Choose Properties ® General from the right-hand pane. You can change the log format, the file name, and the directory of the HTTP Service log files in this tab.

The current state of HTTP Service can be stored in common log format (CLF) and restored in case of a crash. Set the “Log in Common Log Format” indicator to start logging in CLF. You can use the “LogFile (CLF)” property to modify the file name and the directory where the CLF files are stored. It is active only if the “Log in Common Log Format” indicator is set. By default, the path to the common log file is . ./services/http/log/http.log . Enter the file name or the directory (or both) where you want to store your CLF files in the “LogFile (CLF)” field. To save the changes, choose  (Save Properties). The HTTP Service restarts to enable the changes to take effect.

To view the server log files, choose “Log Viewer.” All significant events that occur on the server node are written to log files that correspond to each module. Select the “Log type” dropdown menu on the toolbar to view all log messages. Choose  (Save Properties) to save the log messages in *.log format. A dialog box appears. You can select the name and the directory where you want to save your log messages. Choose “OK” to finish the saving process.

Setting Security Constraints

You can set security constraints for HTTP methods. This associates security roles to one or more of these methods and restricts access to certain resources.

This task is performed at application assembling phase. Constraints are set for a particular application that is to be deployed on SAP J2EE Engine. Logically, they apply for that application only! Therefore, you have the opportunity to set different security constraints for different web applications.

Certain modifications are performed over web.xml descriptor to set the constraints. They are presented by an example of setting such a constraint for HTTP PUT method for a default application named   $SAP_J2EE_Engine_default.

The web.xml descriptor of the application looks like that:

  <web-app>

  <display-name>Default</display-name>

  <welcome-file-list>

  <welcome-file>index.jsp</welcome-file>

  </welcome-file-list>

  <resource-ref>

  <description>description</description>

  <res-ref-name>mail/MailSession</res-ref-name>

  <res-type>javax.mail.Session</res-type>

  <res-auth>Container</res-auth>

  </resource-ref>

  <security-constraint>

  <web-resource-collection>

  <web-resource-name>Protected Area</web-resource-name>

  <http-method>PUT</http-method>

  <url-pattern>/*</url-pattern>

  </web-resource-collection>

  <auth-constraint>

  <role-name>*</role-name>

  </auth-constraint>

  <user-data-constraint>

  <transport-guarantee />

  </user-data-constraint>

  </security-constraint>

  <login-config>

  <auth-method>BASIC</auth-method>

  <realm-name />

  </login-config>

  <security-role>

  <description />

  <role-name>$SAP_J2EE_Engine_default_put_role</role-name>

  <user-name>Administrator</user-name>

  </security-role>

  </web-app>

Note: The tags are not explained in this document. You can find a thorough description of each of them in the JavaÔ Servlet Specification, version 2.3.

As a result, the role $SAP_J2EE_Engine_default_put_role is created, which allows only the Administrator user to perform PUT requests to the $SAP_J2EE_Engine_default application.

Previous  Next