Weblogic Administration


Weblogic Installation
Installation
# cd /opt
# ./wls1211_linux32.bin
Oracle installer will come
     o   Next à  BEA Home directory = /opt/Oracle/Middleware
     o   Choose custom installation  à Deselect workshop option
     o   Select BEA JRockit
     o   Next à Next à Next à Done
     o   It appear Quick Start
Domain Creation
# cd /opt/Oracle/Middleware/wlserver_10.3/common/bin
# ./config.sh
     o   Create new weblogic domain
     o   Generate domain configured automatically
     o   Username/ Password =weblogic/weblogic123
     o   Select production mode à yesà next à
     o   In configured managed server click on “Add”
                    Managedserver1    7003
                    Managedserver2    7005
     o   Next à Domainname=base_domain  à Createà done
Starting weblogic
# cd /opt/Oracle/Middleware/user_projects/domains/base_domain
# ./startWeblogic.sh
Weblogic boot “username/Password =weblogic/weblogic123”
Error:- unable to bind 10.0.2.15 to port 7001, another process is using the port 7001
Sol:- To check which process is using port 7001
# lsof –i :7001  -- > It give PID of process
# kill -9 PID
username/password =weblogic/weblogic123
  
Create a JMS Server
Description: image001
Under Domain Structure, Click on Services > Messaging >JMS Servers
On the JMS Servers Page, Click on “New” button. 
On the Create a New JMS Server  JMS ServerName= “JMSServer-0”
     o   Create a new store
     o   In next page “Select a store type = File store”  à Next
     o   In next page File store properties
              Name= “FileStore-0”
            Target=”AdminServer”
            Directory= /wls/bea/user_projects/domains/base_domain/config/jms/
     o   Next  à Finish
On the screen, select the Persistent Store = “FileStore-0” that we just created and click Next.
     o   Select Target=”AdminServer”  à Finish
JMSModule creation
     o   On left panel, look for Services --> Messaging --> JMS Modules
     o   On Right Panel, Click NEW
     o   On the next screen, fill the details as follows:
Name= “SystemModule-0”
DescriptorFile Name=” SystemModule-0”
Location in Domain=”jms”
     o   Next à Target =”AdminServer”
     o   Next à Select “Would you like to add resources to this JMS System Module”
     o   Finish à Activate Changes
Create a Distributed Queue
     o   Home à JMSModule à select module “SystemModule-0” à click on “New”
     o   select Queue à Next
Name=”Queue-0”
JNDI Name=”InQueue”
Templete=none
     o   à Next à click on “Create a New Subdeployment”
SubDeploymentName=SubDep-0
     o   Next  à Target=”JMSServer-0”
     o   Finish
Note:- A Subdeployment is a convenient way for grouping and targeting JMS module resources.
Creating Connection Factory
     o   click on “New”
     o   Select “ConnectionFactory”à Next
Name=”ConnectionFactory-0”
JNDI Name=”InQueue”
     o   Next à Target=”AdminServer”
     o   Finish
Bridge creation
     o   Home  à Bridge à New
Name = ‘Uninor-0’
Quality of services =Duplicate-okeys
     o   Next à Jms Bridge destination name= ‘JMS Bridge for WIPRO(IN)

How to check how many servers are running in weblogic
Base_domain à Environment à click on servers


USER & GROUP MANAGEMENT
Adding New User
     o   Click on “Security realm à myrealm à user & groups à click on “new”
Username=vivek
Description=new user
Password=mintoosr
Confirm password=mintoosr
     o   Ok
Adding New Group
     o   Click on “Groups à click on “new”
name=Syniverse
Description=Syniverse technology
     o   ok
Adding User to Group
     o   click on created user”vivek” à click on “Group” à select “Syniverse” à OK

 Weblogic Cluster Configuration
Login to Administration Console, using the administrator username and password.
     o   On left panel, look for Environment --> Clusters
     o   On Right Panel, Click NEW
Name=devcluster
Messaging Node=unicast
Description: http://www.togotutor.com/images/weblogic/weblogic-cluster-config.JPG
     o   Click Ok

Virtual Hosting a web application in

Here are the steps how to create a name based virtual host in weblogic server 10 and how to deploy a web application in the virtual host using weblogic console.

Step 1: Create new network channel
A network channel is a unique combination of listen address, listen port, and protocol. In order to create a virtual host you first need to create a network channel.
Go to console -> left pane -> base_domain -> Environemnt ->servers
-> Click Local & Edit
Right pane:
-> Go to 'AdminServer' -> protocols -> channels
-> Click on Lock & Edit  -> Click New
Name=”channel-0", protocol=http
Listen address = 127.0.0.1, Listen Port = 7003,

Leave External Listen address and Leave External Listen Port blank
-> Click on 'Finish'  -> Save changes  -> Activate changes
Try accessing http://127.0.0.1:7003
Step 2. Create new virtual host
Go to console -> left pane -> base_domain -> environement -> virtual hosts
-> Click lock & edit
Right pane :
-> Click on New
-> Enter Name 'VirtualHost-0'
-> save changes -> Activate changes
Step 3: Configure virtual host
Go to console -> left pane -> base_domain -> environement -> virtual hosts
-> Click lock & edit
Right pane:
-> Click on 'VirtualHost-0' virtual host link in the 'Virtual Hosts' table.
-> Enter 'VirtualHost-0.example.com' in the 'Virtual Host Names' text box.
-> Enter ‘channel-0' in the 'Network Access Point Name' text box.
-> Save changes.
-> Click on 'Targets' tab.
-> Select 'AdminServer' in the 'servers' section.
-> Save changes.
-> Activate changes
Step 4. Deploy application to virtual host
Go to Console -> left pane -> base_domain -> deployments
-> Click lock & edit
Right pane:
-> Click on 'Install'
-> Click on "upload your files" link
-> Click "browse" (against 'deployment archive' )
-> select "sample.war"
-> Click "Next"
-> Choose 'sample.war' in the "location" section
-> Choose "Install this deployment as an application" radio button
-> Click on "deployment targets" tab
-> select 'VirtualHost-0' -> Next -> Next -> Finish
-> Save changes
-> Activate changes
Step 5. Create DNS entry in your hosts file.
For linux hosts file is: /etc/hosts Append the following line to the file as super user.
127.0.0.1 VirtualHost-0.example.com
Save the changes to 'hosts' file.
Note: Just saving the changes to 'hosts' file is enough to activate the DNS entry.
Step 6. Start the application.
Go to Console -> left pane -> base_domain -> deployments ->
Right pane:
-> Select 'sample.war'.
-> click on 'Start'.
-> Complete the start process.
Step 7. Access the virtual hosted application.
Now you should be able to access the following url only from the machine where you modified the 'hosts' file as mentioned above. http://VirtualHost-0.example.com:7003/sample/
If you want to use access the above url from any machine, appropriate DNS entries need to be created by your network administrator in your network Router.

Deployment on Weblogic Server
Weblogic supported deployment unit : EAR file, WAR file, JAR files, EJB (Enterprise Java Beans), RAR (Resource Adapter), Web Services (WAR/JAR), J2EE Library, CAR (Client Application Archive)
–  Web Archive configuration file is usually …../WEB-INF/web.xml
–  Enterprise Application (EAR) configuration file is usually …/META-INF/application.xm

Tools used to deploy/configure applications
1) weblogic.Deployer – command line interface
2) Administration Console – Web based interface
3) WLST(WebLogic Scripting Tool) – command line tool to automate deployment and operation
4) Tool for developers (wldeploy, weblogic.PlanGenerator, API, autodeploy)

Steps for Deployment an Application
http(s):// <hostName>:<port>/console 
o   Click on Lock & Edit  à Click on Deployment
o   Click on Install
o   Select Application (war, jar, ear) File
o   Select Install this deployment as Application and click Next
o   Click on Finish
o   Click on Activate changes
o   Start Application by clicking on Start Button



Nodemanager is a Java program which is used to start, stop and monitor managed server process. For a Weblogic Server Administrator working in a bigger environment with several servers in a domain, can be hard and time consuming to control (Start, Stop) the servers.
Using Nodemanager, an administrator can control(start and stop) multiple servers from the weblogic server domain simultaniously.


Description: http://www.togotutor.com/weblogic/images/Nodemanager.jpg



what are the important parameters in nodemanager?
# vi ~/wlserver_10.3/common/nodemanager/nodemanager.properties
There are quite a few like
ListenerPort
ListenerAddress

Note:
Creating Domain
# cd /opt/Oracle/Middleware/wlserver_12.1/common/bin
# ./config.sh
Starting weblogic
# cd /opt/Oracle/Middleware/user_projects/domains/base_domain/bin/
# ./startWeblogic.sh
Enter username to boot weblogic server: weblogic
Enter password to boot weblogic server: weblogic123

# ps –ef |grep java

Configuration file
# vi /opt/Oracle/Middleware/user_projects/domains/base_domain/config/config.xml
______________________________________________________________________________________________
Steps to remove a Domain(base_domain):-
Step 1. Delete domain location tag from domain-registry.xml

# vi /opt/oracle/Middleware/domain-registry.xml
<?xml version="1.0" encoding="UTF-8"?>
<domain-registry xmlns="http://xmlns.oracle.com/weblogic/domain-registry">
  
<domain location="/opt/oracle/Middleware/user_projects/domains/base_domain"/>
</domain-registry>
 

Step 2. If you are NOT using NodeManager to stop and start the WebLogic instance then please IGNORE this step. Remove base_domain from nodemanager.domains
# vi $WL_HOME/wlserver_10.3/common/nodemanager/nodemanager.domains
base_domain=/opt/oracle/Middleware/user_projects/domains/base_domain

Step 3. Delete the domain directory under domains folder manually.
$WL_HOME/user_projects/domains/base_domain
______________________________________________________________________________________________

CONFIGURE APACHE WEBSERVER WITH WEBLOGIC SERVER

Step 1) Make sure the Apache server runs on port 8080.( This is because sometimes IIS, or some antivirus s/w runs on that port).This can be done by modifying the httpd.conf present at
D:\Program Files\Apache Group\Apache2\conf
Modify the Listen port to 8080
Listen 8080
Step 2) Copy the mod_wl_20.so from <bea_home>\wlserver_10.3\server\plugin\win\32 to
D:\Program Files\Apache Group\Apache2\modules
Step 3) Add these lines in the httpd.conf file
LoadModule weblogic_module modules/mod_wl_20.so
<Location />
SetHandler weblogic-handler
</Location>
<IfModule mod_weblogic.c>
WebLogicCluster localhost:7003,localhost:7005
Debug ON
WLLogFile c:/temp/wlproxy.log
WLTempDir c:/temp
</IfModule>
Step 4) Restart Apache and access the application deployed on the Cluster using
http://localhost:8080/YourApp
This will forward the request to the Weblogic Cluster
You can check the headers sent and received to WLS in wlproxy.log file.

what is the default heap size in weblogic???
you can check your setDomainEnv.cmd file for -Xmx and -Xms parameters for the default heap sizes.

Weblogic tutorials links
http://weblogicserveradministration.blogspot.in/
http://crkthoughts.blogspot.in/2009/12/weblogic-faqs.html