Saturday, December 18, 2010

Customize your weblogic server


We knew that, the following lines will start a weblogic server, here we can see how we can customize the settings for weblogic. Here setMyEnv.sh is a file will set the values for your weblogic server, it’s a text file which we can create.

#Start WebLogic server
. "./setMyEnv.sh"
echo Starting server...
nohup "${JAVA_HOME}/bin/java" ${JAVA_VM} ${MEM_ARGS} -cp ${CLASSPATH} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Dweblogic.ProductionModeEnabled=${PRODUCTION_MODE} -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" weblogic.Server 1>>logs/weblogic-console.log 2>&1 &

some points about server startup script

. "./setEnv.sh" – first setEnv.sh file will be executed and the variables will be set then the remaining lines will be executed.


Normally the setMyEnv.sh will call commonEnv.sh of weblogic, the following variables will be set in setMyEnv.sh file,


${JAVA_VM} – It will provide the Java vendor, whether it is Java hot spot or JRockit
${MEM_ARGS} – It will provide the value for initial and maximum memory setting for your weblogic server, the value depends on your hardware and java vendor
${CLASSPATH} – It will provide the classpath Jar files which are required to run your application, here you can add your Library files.
${JAVA_OPTIONS} – There are some pre-defined options which you can pass to weblogic server


-Dweblogic.Domain=${WLS_DOMAINS}
Here you can specify the domain name


-Dweblogic.security.anonymousUserName=guest
User guest can enter into console of the weblogic for read operation

-Dweblogic.allow.lookup.weblogic.jndi=everyone

Any one can look up any JNDI name if they have initial context.

- Dweblogic.allow.lookup.weblogic.jndi.weblogic.management.home
=everyone

Any one can look up JNDI names for Management of weblogic server, like monitoring purpose


Configuration for SSL:
-Djavax.net.ssl.trustStore=${MY_APP_HOME}/ssl/MyAppTrustStore.jks


Here you can specify the certificates for ssl, automatically weblogic will create a keystore and ssl certificates configuration on the weblogic console.

The same way we can specify for keystore also.
-Djavax.net.ssl.keyStore=${ MY_APP_HOME }/ssl/MyAppKeyStore.jks


Configuration for JMS Bridge:
-Dweblogic.debug.DebugMessagingBridgeStartup=true


For Memory arguments:
MEM_ARGS="-Xmx512m -XX:MaxPermSize=512m"

For all weblog.Server options please refer the following site,
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/admin_ref/weblogicServer.html#wp1008628

4 comments:

  1. Dabburi Srinviasa Rao asked this question:

    in setEnv.cmd /sh I could not able to find out the VM_Memory_Args
    could u pls help me i am using WLS 8.1 on windows ?
    In 8.1 - Memory arguments are set in commonEnv.sh, from 9.1 its moved to domain level.

    ReplyDelete
  2. Quite helpful!Thanks for sharing the information.Keep updating good stuff...weblogic administration training

    ReplyDelete

Followers