Wednesday, July 24, 2013

Wednesday, July 17, 2013

How to install Wepshere application server 8 or 8.5 by IBM Installation MANAGER

From version 8 onwards Websphere is using IBM Installation Manager as a single software to do all
installation and upgrades.No need of update installer to  install fixpacks as IBM installation manager will take care of this.

There is a good post in IBM developer works by Scott Johnston
Installing websphere using IBM Installation Manager

Silently Install IBM Installation manager:

  ./installc -acceptLicense

Record a response file to silently install WebSphere Application Server:

  Go to /Installation Manager/eclipse where the IBMIM is present 
 
   ./IBMIM -record /tmp/install_was.xml -skipInstall /tmp/imregistry
   install_was.xml is the name of response file
  skipInstall is used to perform a mock install it wont do the installation

Once IM opens select File->Preferences and click Add Repository.
The repository can be located in local machine ,network drive or IBM passport Advantage

Click Ok.
Explore the IM preferences for the way you want.
Click Ok to  save and close preference window.

Click Install  and then
Select appropriate version,accept license,accept product installation directory and select all features needed.After reviewing the summary click install to record the response file.

Exit on successful recording of response file

Next use the response file to silently install the websphere
Go to InstallationManager/eclipse/tools
./imcl -acceptLicense -input /tmp/install_was.xml -log /tmp/install_was.log

If Installation is success the log file will be empty.

Saturday, July 13, 2013

manageprofiles delete all profiles

APPSERVER_ROOT/bin>manageprofiles.bat -deleteAll

INSTCONFSUCCESS: Success: All profiles are deleted.

After that you can confirm using listProfiles

APPSERVER_ROOT/bin>manageprofiles.bat -listProfiles

[]

If deletion is not success then 
Delete the profile directory  in the system and issue the below command


manageprofiles.bat -validateAndUpdateRegistry

IVT(Installation Verification Tool) in websphere

IVT tool will be present in app_server_root/bin
ex:C:\Program Files (x86)\IBM\WebSphere\AppServer\bin\ivt.bat
ivt.sh in unix environment

C:\Program Files (x86)\IBM\WebSphere\AppServer\bin>ivt.bat
IVTL0150I: The IVT command requires the following arguments:
<SERVER_NAME>
<PROFILE_NAME>
For example, on Linux:
ivt.sh server1 profile01
The IVT tool will first start the server given in the argument and then it scan the sysout log for errors and warnings.  

>ADMU0128I: Starting tool with the Dmgr01 profile
>ADMU3100I: Reading configuration for server: dmgr
>ADMU3200I: Server launched. Waiting for initialization status.
>ADMU3000I: Server dmgr open for e-business; process id is 4452
Server port number is:9060
IVTL0010I: Connecting to the  WebSphere Application Server on port: 90
60
IVTL0015I: WebSphere Application Server  is running on port: 9060 for
profile Dmgr01
IVTL0035I: The Installation Verification Tool is scanning the C:\Program Files (
x86)\IBM\WebSphere\AppServer\profiles\Dmgr01\logs\dmgr\SystemOut.log file for er
rors and warnings.
[13/7/13 22:56:53:169 IST] 00000001 PMIImpl       W   CWPMI0032W: PMI Service is
 not available in the Deployment Manager process.
[13/7/13 22:57:01:624 IST] 00000001 ThreadPoolMgr W   WSVR0626W: The ThreadPool
setting on the ObjectRequestBroker service is deprecated.
[13/7/13 22:57:37:583 IST] 00000080 webapp        W com.ibm.ws.webcontainer.weba
pp.WebApp initializeStaticFileHandler SRVE0278E: Error while adding servlet mapp
ing --> /*.
IVTL0040I: 3 errors/warnings are detected in the C:\Program Files (x86)\IBM\WebS
phere\AppServer\profiles\Dmgr01\logs\dmgr\SystemOut.log file
IVTL0070I: The Installation Verification Tool verification succeeded.
IVTL0080I: The installation verification is complete.




Friday, July 12, 2013

Script to Find server startup time

We have startServer.sh StartManager.sh .. in a  websphere ND environment.If you want to find out the time taken to start a server after some performance changes pleaes add the below lines to the start
script

After the magic line in your start script please add startime=`date "+%s"`
and at the end of the script add
endtime=`date "+%s"`
time=`expr $endtime - $starttime`
echo "time taken to start server in seconds is:" $time

Saturday, July 6, 2013

Change IBM Websphere Admin Console Timeout from 30 mins

1.Go to \profiles\Dmgr01\config\cells\cellname\applications\isclite.ear\deployments\isclite\

2.Open deployment.xml
3.Change invalidationTimeout to the desired value, in minutes, where the maximum value is -1 (do not time out)
4.Restart the WebSphere service on the Network Deployment machine.

Thursday, July 4, 2013

Virtual Host Configuration in Websphere Using Jython and Webserver(Apache or IHS)

What is Virtual Host?

      A virtual host is a configuration  that enables a single host machine to resemble multiple host machines.
Example:Consider  a web hosting company with one webserver.But they can host one or more websites using the same webserver with virtual host configuration.

Virtual Host Configuration in Webserver:

   In httpd.conf file the below lines will be there for virtual host settings:

<VirtualHost *:80>
  ServerName www.example.com
  DocumentRoot /var/www/example
</VirtualHost>
 
<VirtualHost *:80>
  ServerName www.test.com
  DocumentRoot /var/www/test
</VirtualHost> 

In this example Both the  websites www,example.com and www.test.com 
are using the port 80.The files needed for those websites are present in
the respective document root location.
 
Once configuration changes are done in httpd.conf for webserver we can check the 
settings are proper by the command httpd -S.This will result in Syntax OK if 
everything is fine,else corresponding error will be displayed.
 
Use curl command to test the website URL :
curl -I www.example.com 

nslookup ipaddress of the server to check DNS mapping is fine.

Virtual Host Configuration in Websphere:

  1.In Administration Console,Under Environment ->VirtualHosts ->New .
  2.Enter a name for your virtual Host and Save.
  3.Click on newly created Virtual Host and Under Additional Properties, click Host Aliases.
  4.Click New to create host aliases Enter the hostname and port.Use * for all hosts.
  5.Save the configuration.

Jython Script to configure Virtual Host: 

 import sys

new_host=sys.argv[1]
host_name=sys.argv[2]
port=sys.argv[3]
AdminConfig.create('VirtualHost', AdminConfig.getid('/Cell:AdminControl.getCell()/'), '[[name, "+new_host+"]]')
AdminConfig.create('HostAlias', AdminConfig.getid('/Cell:AdminControl.getCell()/VirtualHost:"+new_host+"/'), '[[port ,"+port+"] [hostname ,"+host_name+"]]')

Save this into virtual.py and execute  with cmd ./wsadmin.sh -lang jython -f virtual.py test localhost 9080
test - Virtual Host Name
localhost-HostName
9080-Port
  
  


Tuesday, July 2, 2013

Application already exists in the repository

TimeZone settings websphere

Start applications using wsadmin websphere

from java.lang import Exception as JavaException
myapps=AdminApp.list().splitlines()
for app in myapps:
  x=AdminControl.queryNames('type=Application,name='+app+',*')
  if (len(x) == 0):
    print app 'Application is not started'
    mycell=AdminControl.getCell()
    mynode=AdminControl.getNode()
    mserver=AdminControl.queryNames('node='+mynode+',type=Server,*')
    myserver=AdminControl.getAttribute(mserver,'name')
    appManager = AdminControl.queryNames('type=ApplicationManager,cell='+mycell+',node='+mynode+',process='+myserver+',*')
    try:
     AdminControl.invoke(appManager,'startApplication',app)
    except JavaException,target:
     "WSADMIN EXCEPTION",target 
      
 
Place these lines in jython file named appstatus.py and execute wsadmin using the below option:
 
Go to $WAS_PROFILE/bin and issue the below command
./wsadmin.sh -lang jython -f appstatus.py