Useful commands for WebSphere Application Server: Part 1 -- Application Server administration tasks

Practical, hard-to-find information on several WebSphere Application Sever administrator tasks that are often considered to be common knowledge, compiled in a comprehensive format.

Share:

Lee Perlov, Advisory Software Engineer, IBM

Lee R. Perlov is an Advisory Software Engineer and one of the team leads in the WebSphere Application Server support group. He started working for IBM in 1985 in Gaithersburg, MD, working in the Federal Systems Division on various projects for the United States intelligence community. He then moved to RTP to work on library development and support. Mr. Perlov received a B.S.Acc degree in Accounting from the University of Florida in 1983. He also completed two years of graduate work in the Department of Computer Science at the University of Florida.



Angel Rivera, Advisory Software Engineer, IBM

Angel Rivera is an advisory software engineer and is working with the SDWB and CMVC team in IBM. He joined IBM in 1989 and since then had worked in the development and support of library systems. He was the technical lead for CMVC Version 2 for many years. He was also the team lead of the technical support team for VisualAge TeamConnection. Mr. Rivera has an M.S. in Electrical Engineering from The University of Texas at Austin, and a B.S. in Electronic Systems Engineering from the Instituto Tecnologico y de Estudios Superiores de Monterrey, Mexico.



Edna Kyu, Staff Software Engineer, IBM

Edna Wong Kyu is a Staff Software Engineer for the Software Solutions division at Research Triangle Park. She joined IBM in 1987 and has worked in testing, VM systems programming, support of library platforms and support of various UNIX platforms. Mrs. Kyu received a B.A. in Computer Science and a minor in Business from New York University in 1985.



25 November 2002

Introduction

This two-part article covers essential and practical information for WebSphere® Application Server administrators, and for system administrators who must cope with the heterogeneous operating system and database environments supported by WebSphere Application Server. Since this information, which is often considered common knowledge for administrators, is sometimes difficult or cumbersome to obtain, instructions and commands for getting this important data has been compiled here in a simple, comprehensive format.

Part 1 includes information on tasks performed by WebSphere Application Server administrators. Part 2 includes information on tasks performed by system administrators. Each task is grouped, where appropriate, into sections focusing on UNIX® (AIX®, Solaris™ and Linux) and Windows®.

This article assumes the reader is familiar with basic UNIX and/or Windows concepts. Some tasks presented here are UNIX-specific, due to the multi-user characteristics of this class of operating system. Finally, keep in mind that unless there is a need to refer to a specific version:

  • The names of operating systems will be used without version numbers. For example, the term "AIX" in this document will refer to AIX Version 4.3.2 or later.
  • The term UNIX will be used as a generic term for all the different UNIX versions.
  • The term Windows will be used as a generic term for both Windows NT© and Windows 2000.

Basic information resources

Today, it is common for developers to deploy WebSphere applications to production using WebSphere Application Server Version 4.0, Advanced Edition, while developing them on WebSphere Application Server Advanced Single Server Edition (single server with no database repository). Naturally, it's crucial for all involved to have current and comprehensive technical information available on all aspects of developing with WebSphere Application Server. The information presented in the sections that follow supplement the definitive material that is available from these resources:

Documents available on these IBM Web sites supercede any corresponding versions delivered via CD-ROM.


Finding what versions are running

While version information is available from the admin console, it is also available for most IBM products in the source file product.xml. Beginning with WebSphere Application Server Version 4.0.x, this file will also include information on eFixes that have been installed. Access this file for WebSphere Application Server using these commands:

WebSphere Application Server

Operating systemCommand
AIXcat /usr/WebSphere/AppServer/properties/com/ibm/websphere/product.xml
Solaris/Linuxcat /opt/WebSphere/AppServer/properties/com/ibm/websphere/product.xml
Windowsc:\WebSphere\AppServer\properties\com\ibm\websphere\product.xml

The most common software prerequisites for which you will need to check version numbers are listed below. Use these commands or instructions to help you get the appropriate version information. Issue these commands from a command prompt window, unless otherwise specified.

Other software

Operating systemCommand
Java JDK
UNIX./java -version
Windowsjava -version

Notes:

  • Starting with JDK 1.2.x, java -version contains more information than java -fullversion.
IBM HTTP Server
AIX/usr/HTTPServer/bin/httpd -v
Solaris/Linux/opt/HTTPServer/bin/httpd -v
Windowsc:\Program Files\IBM HTTP Server\apache -v

Notes:

  • The version of IBM HTTP Server will also report IHS's version and the underlying version of Apache.
  • Yes, the name of the executable is different in UNIX and Windows.
Browsers and other GUI toolsFrom the menu bar of the Web browser, select Help -> About...
X-Windowsxrdb -symbols

Notes:

  • Check the symbols for VERSION and RELEASE.
  • Since Hummingbird Exceed© is an X-Windows server, xrdb will report the version of X-Windows that Exceed supports, like any other X-Windows server.

Location of WebSphere code

The table below shows the default locations for the WebSphere Application Server code:

AIX/usr/WebSphere/AppServer
May also have alias: /usr/WebAS
Solaris/Linux/opt/WebSphere/AppServer
May also have alias: /opt/WebAS
Windowsc:\WebSphere\AppServer

The home directory for WebSphere Application Server will be referred to as WAS_HOME throughout this document, since this variable is set during execution of the Windows batch files or the UNIX script files that start WebSphere and its associated tools:

UNIXsetupCmdLine.sh
(in WAS_HOME/bin)
WindowssetupCmdLine.bat
(in WAS_HOME\bin)

Location of WebSphere customization files

While the majority of configuration options are stored in the repository database, some properties may be modified in the bin/admin.config file in the properties directory. Batch files or scripts in the bin directory may also be modified, for example, to accomodate a JDK upgrade.

To extract the configuration from the database use the command: XMLconfig -export FileName -adminNodeName HostName

For example: XMLconfig -export WasServer1.xml -adminNodeName WasServer1


Automating WebSphere administration tasks

WebSphere provides two tools to help automate WebSphere administrative tasks:

XMLConfig
  • An XML-based tool for starting and stopping processes, changing configurations, and installing applications.
  • Runs asynchronously, meaning a task must be completed before the next step is executed. This type of processing must be accomodated in an automation script.
  • Easy to set up, since you can export a configuration using XMLConfig, then modify it for use in an automated scenario.
WCSP
  • A TCL-based tool, comparable in function to XMLConfig.
  • Runs syncnronously and provides a return code, making WCSP ideal for automation scripts.

Examples of using both of these program are available in the WebSphere Application Server InfoCenter.


Emptying log files

For the purpose of problem determination, it is very helpful to delete or empty log files each time WebSphere Application Server is stopped and started. Further, it is often easier to empty the files than delete them, particularly in cases where the permissions had to be changed, such as when running the application server as non-root. To do this, enter the following commands from a command prompt window:

UNIXcp /dev/null logfile.log
Windowscopy nul: logfile.log

Although it may occasionally be desireable to empty log files while WebSphere Application Server is running, it is not recommended that you do so. Always stop WebSphere Application Server prior to "nulling out" log files.

On UNIX, new log files may be automatically generated on a regular basis, such as daily or each time a process is started. After a newer log file has been generated, older empty log files can be deleted with this command: find $WAS_HOME/logs -size 0 -exec rm {} \;


Finding what processes are running

In some situations, it is not always obvious what runtime processes are actually running, or whether a specific process is running or not. Use these system commands to indentify which processes are running at a given time:

UNIX

To see the processes related to WebSphere that are running, use this command: ps -ef | grep -i java

Of course, not all Java processes will necessarily be WebSphere-related. Java processes run by WebSphere Application Server generally have longer argument lists. Special parameters must be used to find all WebSphere processes that are running on some UNIX operating systems:

SolarisThere is typically a different ps command in /usr/bin:
/usr/ucb/ps -auxww
AIX/usr/bin/ps -elf

Issue these commands in a command prompt window to find out which processes are running that are associated with WebSphere Application Server:

Admin server processps -ef | grep java | grep AdminServer
Nanny process
(restarts servers that terminate)
ps -ef | grep java | grep Nanny
Other processesps -ef | grep java | grep ManagedServer

In Linux, each thread runs in a separate process.

There are two easy ways to check which processes are running in Windows:

Windows
Using Task Manager: From the task bar (default location is at the bottom of the screen), right-click and select Task Manager -> Applications -> Processes. The active processes along with the actual names of the executables will be displayed.
Using net start:
  • Use the command C:\>net start to start these Windows services:
    • Computer Browser
    • DB2 - DB2
    • IBM HTTP Server
    • EventLog
  • You may also use the actual process title with the command if you know it. For example:
    • C:\>net start "IBM HTTP Server"
    • C:\>net stop "IBM HTTP Server"

What to backup

When backing up files for WebSphere Application Server, be absolutely sure the files and information listed here are included your backup:

  • The XMLConfig -export command will document the current configuration in the repository.
  • The files admin.config (or server-cfg.xml for WebSphere Application Server Advanced Single Server Edition) and setupCmdLine.sh/setupCmdLine.bat document the environment settings required to connect to the repository.
  • The files obj.conf/httpd.conf and appropriate SSL files, if used (e.g. *.sth, *.kdb), document the webserver's configuration.
  • Beginning with WebSphere Application Server Version 4.0, all user applications are delivered as EAR, WAR or JAR files. These should be backed up as well, but that is actually done outside of WebSphere. The same is true for static Web pages written by users and served by the Web server.

Using CD-ROMs during installation

WebSphere Application Server is installed from CD-ROM. (Fixpaks are available via download .) The information provided here will be helpful when dealing with CD-ROMs in these various configurations, since each operating system handles CD-ROMs differently.

AIX

In AIX, a CD-ROM must be logically mounted before it can be accessed by the system for installation.

To mount a CD-ROM in AIX:

  1. Insert the CD-ROM into the CD-ROM drive.
  2. Log in as user ROOT or type su - root to login using the root profile.
  3. Create a /cdrom directory by entering mkdir /cdrom.
  4. Enter smit to add a CD-ROM file system.
  5. Select System Storage Management (Physical & Logical Storage) -> File Systems -> Add/Change/Show/Delete File Systems -> CDROM File Systems -> Add a CDROM File System.
  6. Select a device name, such as cd0. CD-ROM file system device names must be unique.
  7. Type /cdrom to get the Mount Point prompt.
  8. Select OK, or press Enter if using the smit ASCII interface, returning to the previous smit level, System Storage Management (Physical & Logical Storage).
  9. Select File Systems -> Mount a File System.
  10. For file system name, select /dev/cd0.
  11. For directory over which to mount, select /cdrom.
  12. For type of file system, select cdrfs.
  13. For Mount as a READ-ONLY system, select Yes.
  14. Select OK, or press Enter if using the smit ASCII interface.
  15. Exit smit.

To install WebSphere Application Server from CD-ROM using tar files:

  1. Add and mount the CD-ROM, following the steps above.
  2. Log in with root authority.
  3. Change the directory to /cdrom.
  4. Invoke ./install.sh by following the standard installation instructions.
  5. When the installation is complete, dismount the CD-ROM by typing: cd .. umount /cdrom.
  6. Eject the CD.

Solaris

If Volume Management is running on Solaris, the operating system will logically mount the CD-ROM as soon as it is inserted into the drive. If Volume Management is not running, you will need to logically mount the CD-ROM.

To mount a CD-ROM on Solaris:

  1. Login as root.
  2. Start the Volume Management daemon by executing the commands:

    /etc/init.d/volmgt start
    ps -ef | grep vold

    Process /usr/sbin/vold should then be started.

To install WebSphere Application Server from CD-ROM using tar files:

  1. Insert the CD-ROM into the CD-ROM drive and mount, if necessary. The CD-ROM will be mounted, for example, as /cdrom/was350. When a CD-ROM is inserted as root, a File Manager window will be started. Do not kill it. You need this window to eject the CD-ROM. If you kill the window, an orphan process will be using the CD-ROM, resulting in "device busy" errors when you try to eject the CD.
  2. Log in as root and run the CD by typing: cd /cdrom/was350
  3. Invoke ./install.sh by following the standard installation instructions.
  4. When the installation is complete, dismount the CD-ROM by typing: cd eject cdrom.

To detect if a CD-ROM is already in the drive, use the volcheck command. For example: $ volcheck -v /cdrom. If no CD-ROM is present, the message /cdrom has no media will display.

HP-UX

In HP-UX, a CD-ROM must be logically mounted before it can be accessed by the system for installation.

To mount a CD-ROM on HP-UX:

  1. Insert the CD-ROM into the CD-ROM drive.
  2. Log in as user ROOT or type su - root to login using the root profile.
  3. Issue the mount command to determine if the CD-ROM file system is already mounted and operational by verifying that /cdrom is listed. If it is, then you may install the contents of the CD. If not, then you need to create a file system and then logically mount the CD-ROM by continuing with the remaining steps.
  4. Create a directory for the CD-ROM, by typing: mkdir /cdrom.
  5. Type: sam &
  6. Select Disks -> File Systems -> Disk Devices -> CDFS (for CD-ROM File System).
  7. From the menu bar, select Actions -> View more information -> Show Device Files.
  8. Do not select raw devices such as /dev/rdsk/c0t2d0. Make a note of the value for Device File. For example, in HP-UX 10, it might be: /dev/dsk/c0t2d0.
  9. Close the windows and exit sam.
  10. Logically mount the CD-ROM drive manually with the command: mount /dev/dsk/c0t2d0 /cdrom
  11. Issue the mount command again and verify that /cdrom is listed.

The normal mount in HP-UX is sometimes unable to handle very long file names, which may hinder the installation of DB2. To overcome this:

  1. Mount the CD-ROM with the command: pfs_mountd & pfsd 4& pfs_mount /CDROM
  2. Proceed with the installation as normal.
  3. When you have finished using the CD, unmount the CD usith the command: pfs_umount /CDROM

Always unmount the CD before logging out of the session to avoid shutdown problems or the need to reboot.

Windows

Windows recognizes the CD-ROM drive during boot and treasts it as a read-only drive.


Conclusion

Hopefully, the information presented here will help WebSphere Application Server administrators quickly find the commands they need to perform specific tasks with this product. In Part 2, the scope of commands includes tasks related to system administration.

Acknowledgements

Many of the questions and answers compiled in this document were obtained from co-workers. We wish to thank in particular Jessica Greco and Larry Henson.

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=13133
ArticleTitle=Useful commands for WebSphere Application Server: Part 1 -- Application Server administration tasks
publish-date=11252002