Vous êtes sur la page 1sur 16

What is Application Server? Application servers extend a Web server's capabilities.

Web Server VS Application Server: Web server provides only Servlet container. Example is Tomcat. Application Server provides Servlet container & EJB Container. Examples are
WebSphere, BEA, JBoss.

An example Consider an online store that provides real-time pricing and availability information. Scenario 1: Web server:The Web server takes your request, passes it to a server-side program able to handle the request. (Servelt / JSP) The server-side program looks up the pricing information from a database or a flat file. Once retrieved, the server-side program uses the information to formulate the HTML response Web server sends it back to your Web browser. To summarize, a Web server simply processes HTTP requests by responding with HTML pages. Scenario 2: Application server The application server serves the business logic for looking up a products pricing information. (EJB component) When a client calls the application servers lookup service, the service simply looks up the information and returns it to the client. By separating the pricing logic from the HTML response-generating code, the pricing logic becomes far more reusable between applications. What is Web Application? A Web application on WebLogic Server includes the following files: At least one servlet or JSP, along with any helper classes. A web.xml deployment descriptor, a J2EE standard XML document that describes the contents of a WAR file.

A weblogic.xml deployment descriptor, an XML document containing WebLogic Server-specific elements for Web applications. A Web application can also include HTML and XML pages with supporting files such as images and multimedia files Web Application directory structure:

myWebApp/ WEB-INF/ web.xml weblogic.xml lib/ MyLib.jar classes/ MyPackage/ MyServlet.class index.html index.jsp

Anything under the root directory excepting the WEB-INF directory is publically available, and can be accessed by URL from browser. Deployment: WebLogic Server allows you to store deployment units either as, Single archive file (WAR) Exploded directory that contains the same contents of the archive file. (portal folder in Answers Portal)

Creating Domain in Weblogic:


A domain is the basic administration unit for WebLogic Server instances. A domain consists of one or more WebLogic Server instances (and their associated resources) that you manage with a single Administration Server. Each domain's configuration is stored in a separate configuration file called config.xml

Admin server and Managed server: Each WebLogic Server domain must have one server instance that acts as the Administration Server.
Server instances other than the Administration Server are referred to as Managed Servers. Managed Servers in a domain can start up independently of the Administration Server if the Administration Server is unavailable. Two or more Managed Servers can be configured as a WebLogic Server cluster to increase application scalability and availability. All Managed Servers in a cluster must reside in the same domain; you cannot "split" a cluster over multiple domains

Domain Creation:

Configuration wizard 1. Goto <weblogicHome>\common\bin click on config.cmd. This opens configuration wizard.

2. Choose Template

click next 3. Choose Installation type (Express/Custom). Choose Express.

4. Configure Administrative Username and Password Create default administrative user details for this domain

5. Configure Server start Mode & Choose JDK

6. For Development mode leave as is otherwise choose production

7. Change the name of the domain by changing the configuration Name and click Create

Creates a new folder user_projects/domains/<domain Name>/

Start Domain Server Go to <bea>/user_projects/domains/<domainName1> and click on startWeblogic.cmd to start this domain.

Starting Admin Console:


Open admin console http://localhost:7001/console.

Enter the new user id/password created in step 4 of domain creation in weblogic

Domain Name created in the previous step (Domain creation in weblogic)

Uses of the System Administration Console


You can use the System Administration Console to:
Start, and stop WebLogic Server Instances Deploy applications Configure database connectivity (JDBC), and messaging (JMS) Configure WebLogic Server Clusters ing managing users, groups,

Configure security parameters, include and roles

Monitor server and application performance View server and domain log files View application deployment descriptors Edit selected runtime application deployment descriptor elements

In the console on the left menu, click on deployments Web Application Modules.

On the right pane, click on deploy New Web Application Module on the next page On the target page, select the war file and click on Deploy. This deploys the war into weblogic server. In the result page, click on Test tab and click on check status link which will open the welcome page of the application. On the left page, click on mydomaindeploymentsweb application Modules. On the right pane, click on the deployed applications deploy tab, click on redeploy window. This re-deploys the war file into weblogic server.

Connection Pool Creation


Pre-requisite Database created with required Tables Required Information to create Connection Pool Database Name Host name Port Database User Name Password Configure DB Connection Pool Properties in Weblogic 1) Open admin console 2) Go to ServicesJDBC 3) Select Database Type, driver, Connection Pool Name, Database Name, Host name, Port Name, Database User Name and Password.

4) Click on Test Driver Configuration to test driver config 5) If the test is successful, click on create and deploy 6) This creates DB connection pool

Logging
Server Logs Server log file will be generated under <user Domain>\domains\<ApplicationName>\<serverName>\<serverName>.lo g The same could be retrieved from admin console. 1) Go to <Domain>ServersChoose<Server> on the left pane 2) Click on logging on the right pane 3rd tab. This provides logging information

3) At the bottom of the page, click on the link View Server Log.

Create Users

Follow the steps to create users in weblogic server 1) Go to DomainSecurityRealmsdefault Realm(myrealm)Users on the left pane (figure 1) 2)

3) Click on Configure a new user on the right pane.

4)

5) Enter the details and click on apply. This creates a user. Follow the same steps to create multiple users
Create Groups

Steps to create Groups 1) Go to domainssecurityRealmsdefault realm (myrealm) Groups on the left pane 2) Click on configure a new Group on the right pane.

3) 4) Click on Apply.
Nested Groups

1) Nesting Groups can be created by clicking on the Group name hyperlink on the result page (DomainsSecurityrealmsmyrealmgroupstestGroup 2) Click on Create new group link on the group page.

3) Create a New group and save 4) In the result page, click on the nested group name created now and go to membership tab, select the group in which this group needs to be added as nested and click on apply 5)

Assign users to groups

In the above sections, we created users and groups. In this section, we will discuss about how to assign groups for the created users. 1) Select the user created from domainssecurityRealmsmyrealmusers. 2)

3) Click on the user name which was created in previous sections 4) Click on groups tab in the right pane. 5) Choose the groups from possible groups to current groups. One user can be assigned to multiple groups. 6) Click on Apply.
Security Roles

Security Role is a privilege given to users or groups to access weblogic resources based on specific conditions. Security Roles are different from groups in the following ways. 1) Security Roles are granted to users/Groups dynamically, based on conditions such as user name, group membership, time of the day etc.

2) Security Roles can be scoped to specific resources within a single application in weblogic server domain.
Global Roles

A Security Role applied to all resources deployed in a weblogic realm is called global scope. The following steps describe about creating Global roles. Steps to create global roles 1) Go to <domain>securityRealmmyrealmglobal roles on the left pane 2) Click on Configure new global role link on the right pane. 3) Enter the name of the role and click on apply 4) In the saved role, click on role name, click on conditions tab to add conditions to this role.

5) Choose the role condition and enter value. Click on apply to save.
Scoped Roles

A security role that applies to a specific instance of a WebLogic resource deployed in a security realm (such as a method on an EJB or a branch of a JNDI tree) is called a scoped role Steps to create Scoped Role 1) Go to DomainsDeploymentsChoose the module/File you want to define the scoped Role 2) Right click and choose Define Scoped Role from the right menu.

3)

4) Click on configure new scoped role 5) Enter the role name and click on apply. 6) In the saved Role, click on the role name to edit the role settings and click on Conditions tab to add conditions and save. 7) This enables a security for that resource.
Security Policy

This is an association between resources, users, groups and roles and designed to protect the resources.

References
Weblogic Online Documentation: http://edocs.beasys.com/wls/docs81/ http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=40 http://forums.bea.com/category.jspa?categoryID=2004 Understanding weblogic domains: http://edocs.bea.com/wls/docs81/adminguide/overview_domain.html#1104887

Vous aimerez peut-être aussi