![]() |
|
A Web application contains application resources such as servlets, JSPs and JSP tag libraries, and static resources such as HTML pages and image files. A Web application can also define links to resources outside the application such as EJBs. Web applications are deployed on Pramati Web Container, which manages the execution of Web components. Server supports deployment of Servlets 2.4 and JSP 2.0 components.
When you install and start Server, the Web container is installed and started by default. You can configure a node in a cluster to be a pure Web node.
Note: To view Web container details, select Monitor > Web Server in the Explore panel of the Console.
Package these files as .war or .ear files and deploy them on Server. Application-related information is extracted to the document root. When a client makes a request, the application is accessed from this location.
An open structured application need not be packaged into .war or .ear files. You only need to copy the application files to the Server document root. You can also deploy exploded directories. Instead of copying, Pramati Server serves the application from the deployed directory.
A Web application can also access external resources such as EJBs and JSP tag libraries. A server can host any number of Web applications.
The context root should be unique for a virtual host in the Server namespace. The context root is the root under which the archive content is available. To modify the context root name, click the name and type the new context root name. To avoid using any context root while accessing the application, use the context root ‘/’. You can access the application with http://<host>:port.
When you select the Web archive row in this panel, the EJB-ref type, the bean interfaces, and an optional description are displayed. The description field is editable.
This panel contains the following attributes:
web.xml file. It includes resources that were directly bound on the server as well as resources of the same type from the deployed .rar files.When you select a .war node, the resource type, the resource authorization, and an optional description are displayed. The following types of resources can be directly mapped to the Server:
javax.sql.DataSourcejavax.jms.QueueConnectionFactoryjavax.jms.TopicConnectionFactoryjavax.mail.Session, java.net.URLIf the resource is bound by a .rar, the type may be any other type representing the JCA connection factory class.
It contains the resource environment reference name and an indication of the resource environment reference type expected by the Web application code. For JMS, the resource environment reference can be selected from javax.jms.Queue and javax.jms.Topic. The drop-down list displays only resource environment type objects.
The deployer can select the value assigned to the .war’s resource environment reference.
To open the Security panel, click the Security node in the Deploy Tool. Assign realm roles to the security roles defined in the wars. The available realm roles are obtained from the Security service. This panel contains the following attributes:
Note: If you face a problem, check Monitor > Logs in the Console.
Table 1: Realm attributes
| Attributes | Description |
|---|---|
| Realm | Specifies the realm name. |
| Module | Displays the WAR name or the application-level role name in the security role. |
| Role Name | Displays all the role names that have already been defined for the application. |
| Role Link | Specifies the name of the security role. |
method-permission element in the ejb-jar.xml. The element specifies that one or more security roles are allowed to invoke one or more enterprise bean methods. The method-permission element consists of an optional description, a list of security role names or an indicator to state that the method is unchecked for authorization, and a list of method elements.
The security roles used in the method-permission element must be defined in the security-role elements of the deployment descriptor, and the methods must be methods defined in the enterprise bean's component and/or home interfaces.
You can map roles to multiple realms using the Deploy Tool. To do so, use the following steps:
pramati-j2ee-server.xml:
<role-mapping> <module-name>ejb_secEbmp_sec_ejb.jar</module-name> <role-name>VP<role-name> <role-link> <group-principal>everybody<group-principal> <group-principal>administrator<group-principal> <user-principal>root</user-principal> </role-link> </role-mapping>
When you deploy an archive on Server, the following structure and files are created:
<install_dir>/server/nodes/<node_name>, which contains all the deployed classes and files. <node_name> is the name of the configured node on which the application has been deployed.<install_dir>/server/nodes/<node_name>/archives/public_html/context_root in the appropriate package hierarchy. war_name is the name of the .war.When you undeploy the application, all these files are removed from the specified location.
web-config.xml file. The log file is located at <install_dir>/server/nodes/<node_name>/config.
In the web-log parent tag, set the value of log-on tag to true. For example:
<web-log> <log-on>true<log-on> <dir-path>$NODE_DIR\abc<dir-path> </weblog>
Note: You can set this option before starting the Server.
In Apache CLF, information is stored in the format string as: "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"
Table 2: Values for Apache combined log format
| Value | Description |
|---|---|
| h | The IP address of the client (remote host) which made the request to the server. |
| l | Remote log name. |
| u | The userid of the person requesting for the document as determined by http authentication. The same value is typically provided to CGI scripts in the REMOTE_USER environment variable. |
| t | The time at which Server finished processing the request. |
| r | The request line from the client enclosed in double quotes. Contains information regarding the method used by the client, the name and type of resource, and the protocol used. |
| s | The status code sent back to the client by Server. Code begining with 2 indicates that the request resulted in a successful response, code begining with 3 indicates a redirection, code beginning with 4 indicates that an error has been caused by the client, codes beginning with 5 indicates an error in the server |
| b | This indicates the size of the object returned to the client. This does not include the response headers. |
| (Referer)i | The "Referer" HTTP request header. This gives information about all the sites and files that the client has accessed. |
| (User agent)i | The User-Agent HTTP request header. The client browser identifies itself with this information. |
For example:
127.0.0.1 - username [10/Mar/2002:13:55:36 -0700] "GET /pramati.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"
log-on tag to true.
Note: The contents are purged when the file size is big before logging new information in this file. This is taken care of by the operating system. The server automatically saves the contents of this file before purging.
For example:
127.0.0.1 - username [10/Mar/2002:13:55:36 -0700] "GET /pramati.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"
http://www.mrunix.net/webalizer (free) http://www.thefreecountry.com/webmaster/loganalyzers.shtml (free) http://www.softjam.co.uk/acatalog/Log_Analysers.html (at a price)
javax.servlet Class GenericServlet.
To use the APIs, the com.pramati.web.logging property should be set to true. To set this property, while starting the Server, at the java prompt, type:
java -Dcom.pramati.web.logging=true com.pramati.Server -verbose
To log whatever information is passed into the Server Logs, you can call any of the following two methods:
public void log(java.lang.String message, java.lang.Throwable t)public void log(java.lang.String msg)public void log(java.lang.String message, java.lang.Throwable t)
This method writes an explanatory message and a stack trace for a given throwable exception to the servlet log file, prepended by the servlet's name.
Table 3: Parameters for generating servlet logs
| Parameters | Description |
|---|---|
| message | A string that describes the error or exception. |
| t | The java.lang.Throwable error or exception. |
public void log(java.lang.String msg)
This method writes the specified message to a server log file, prepended by the servlet's name.
Table 4: Parameters for generating servlet logs
| Parameters | Description |
|---|---|
| msg | A string specifying the message to be written to the log file. |
The log file gets saved at <install_dir>/server/nodes/<node_name>/logs.
By default, the Deploy Tool's log file is located at <user.dir>/Temp/DeployTool/logs/DeployToolTrace.log. The location of the file can be changed by setting the system property com.pramati.deploytooltracefile to point to a properties file that contains the new location or by using the option tracefile command line to point to the tracefile.props containing the logging options.
| © Pramati Technologies 2007 | Runs on Pramati Server | Feedback | Legal |