Home / Articles / Middleware / weblogic / 12.2.1.4 / wls-admin-server-setup

WebLogic Admin Server Setup

Prerequisites

Create WebLogic Domain

  • Login as weblogic user
  • Set WebLogic environment
  • # . $WLS_HOME/server/bin/setWLSEnv.sh CLASSPATH=/opt/jdk1.8.0_241/lib/tools.jar:/opt/weblogic/12.2.1.4.0/wlserver/modules/features/wlst.wls.classpath.jar: PATH=/opt/weblogic/12.2.1.4.0/wlserver/server/bin:/opt/weblogic/12.2.1.4.0/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/opt/jdk1.8.0_241/jre/bin:/opt/jdk1.8.0_241/bin:/opt/jdk1.8.0_241/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/weblogic/.local/bin:/opt/weblogic/bin:/opt/weblogic/12.2.1.4.0/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin Your environment has been set.
  • Create template file for creating domain
  • Setting following parameters in the file. Update the values as per your setup.

    readTemplate('/opt/weblogic/12.2.1.4.0/wlserver/common/templates/wls/wls.jar') cd('Servers/AdminServer') set('ListenAddress','192.168.50.71') set('ListenPort',7001) create('AdminServer','SSL') cd('SSL/AdminServer') set('Enabled','True') set('ListenPort',7002) cd('/') cd('Security/base_domain/User/weblogic') cmo.setPassword('Test1234') setOption('OverwriteDomain','true') writeDomain('/opt/weblogic/12.2.1.4.0/wlserver/config/domains/TEST') closeTemplate() exit()

    # vi /tmp/createWLSDomain.py #======================================================================================= # This is an example of a simple WLST offline configuration script. The script creates # a simple WebLogic domain using the Basic WebLogic Server Domain template. The script # demonstrates how to open a domain template, create and edit configuration objects, # and write the domain configuration information to the specified directory. # # This sample uses the demo Derby Server that is installed with your product. # Before starting the Administration Server, you should start the demo Derby server # by issuing one of the following commands: # # Windows: WL_HOME\common\derby\bin\startNetworkServer.cmd # UNIX: WL_HOME/common/derby/bin/startNetworkServer.sh # # (WL_HOME refers to the top-level installation directory for WebLogic Server.) # # The sample consists of a single server, representing a typical development environment. # This type of configuration is not recommended for production environments. # # Please note that some of the values used in this script are subject to change based on # your WebLogic installation and the template you are using. # # Usage: # java weblogic.WLST # # Where: # specifies the full path to the WLST script. #======================================================================================= #======================================================================================= # Open a domain template. #======================================================================================= readTemplate("/opt/weblogic/12.2.1.4.0/wlserver/common/templates/wls/wls.jar") #======================================================================================= # Configure the Administration Server and SSL port. # # To enable access by both local and remote processes, you should not set the # listen address for the server instance (that is, it should be left blank or not set). # In this case, the server instance will determine the address of the machine and # listen on it. #======================================================================================= cd('Servers/AdminServer') set('ListenAddress','192.168.50.87') set('ListenPort', 7001) create('AdminServer','SSL') cd('SSL/AdminServer') set('Enabled', 'True') set('ListenPort', 7002) #======================================================================================= # Define the user password for weblogic. #======================================================================================= cd('/') cd('Security/base_domain/User/weblogic') # Please set password here before using this script, e.g. cmo.setPassword('value') cmo.setPassword('Test1234') #======================================================================================= # Create a JMS Server. #======================================================================================= cd('/') create('myJMSServer', 'JMSServer') #======================================================================================= # Create a JMS System resource. #======================================================================================= cd('/') create('myJmsSystemResource', 'JMSSystemResource') cd('JMSSystemResource/myJmsSystemResource/JmsResource/NO_NAME_0') #======================================================================================= # Create a JMS Queue and its subdeployment. #======================================================================================= myq=create('myQueue','Queue') myq.setJNDIName('jms/myqueue') myq.setSubDeploymentName('myQueueSubDeployment') cd('/') cd('JMSSystemResource/myJmsSystemResource') create('myQueueSubDeployment', 'SubDeployment') #======================================================================================= # Create and configure a JDBC Data Source, and sets the JDBC user. #======================================================================================= cd('/') create('myDataSource', 'JDBCSystemResource') cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource') create('myJdbcDriverParams','JDBCDriverParams') cd('JDBCDriverParams/NO_NAME_0') set('DriverName','org.apache.derby.jdbc.ClientDriver') set('URL','jdbc:derby://localhost:1527/db;create=true') set('PasswordEncrypted', 'PBPUBLIC') set('UseXADataSourceInterface', 'false') create('myProps','Properties') cd('Properties/NO_NAME_0') create('user', 'Property') cd('Property/user') cmo.setValue('PBPUBLIC') cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource') create('myJdbcDataSourceParams','JDBCDataSourceParams') cd('JDBCDataSourceParams/NO_NAME_0') set('JNDIName', java.lang.String("myDataSource_jndi")) cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource') create('myJdbcConnectionPoolParams','JDBCConnectionPoolParams') cd('JDBCConnectionPoolParams/NO_NAME_0') set('TestTableName','SYSTABLES') #======================================================================================= # Target resources to the servers. #======================================================================================= cd('/') assign('JMSServer', 'myJMSServer', 'Target', 'AdminServer') assign('JMSSystemResource.SubDeployment', 'myJmsSystemResource.myQueueSubDeployment', 'Target', 'myJMSServer') assign('JDBCSystemResource', 'myDataSource', 'Target', 'AdminServer') #======================================================================================= # Write the domain and close the domain template. #======================================================================================= setOption('OverwriteDomain', 'true') writeDomain('/opt/weblogic/12.2.1.4.0/wlserver/../user_projects/domains/ltsDOMAIN') closeTemplate() #======================================================================================= # Exit WLST. #======================================================================================= exit()
  • Run WLST script to create domain using the config file we just created.
  • # java weblogic.WLST /tmp/createWLSDomain.py Initializing WebLogic Scripting Tool (WLST) ... Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away. Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Exiting WebLogic Scripting Tool.
  • Check the newly created domain configuration files
  • # ls -l /opt/weblogic/12.2.1.4.0/wlserver/../user_projects/domains/ltsDOMAIN drwxrwxr-x 2 weblogic weblogic 24 Aug 29 17:50 autodeploy drwxrwxr-x 6 weblogic weblogic 4096 Aug 29 17:50 bin drwxrwxr-x 3 weblogic weblogic 16 Aug 29 17:50 common drwxrwxr-x 9 weblogic weblogic 135 Aug 29 17:50 config drwxrwxr-x 2 weblogic weblogic 24 Aug 29 17:50 console-ext -rw-rw-r-- 1 weblogic weblogic 327 Apr 26 2019 fileRealm.properties drwxrwxr-x 3 weblogic weblogic 318 Aug 29 17:50 init-info drwxrwxr-x 2 weblogic weblogic 24 Aug 29 17:50 lib drwxrwxr-x 2 weblogic weblogic 63 Aug 29 17:50 nodemanager drwxrwxr-x 2 weblogic weblogic 6 Apr 26 2019 resources drwxrwxr-x 2 weblogic weblogic 167 Aug 29 17:50 security drwxrwxr-x 3 weblogic weblogic 25 Aug 29 17:50 servers -rwxr-x--- 1 weblogic weblogic 272 Aug 29 17:50 startWebLogic.sh

    Start WebLogic Server

    • Login as weblogic user
    • Start WebLogic Server from the start script from the ltsDOMAIN directory
    • # $DOMAIN_HOME/bin/startWebLogic.sh JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 . CLASSPATH=/opt/jdk1.8.0_241/lib/tools.jar:/opt/weblogic/12.2.1.4.0/wlserver/server/lib/weblogic.jar:/opt/weblogic/12.2.1.4.0/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/opt/weblogic/12.2.1.4.0/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/opt/weblogic/12.2.1.4.0/wlserver/common/derby/lib/derbynet.jar:/opt/weblogic/12.2.1.4.0/wlserver/common/derby/lib/derbyclient.jar:/opt/weblogic/12.2.1.4.0/wlserver/common/derby/lib/derby.jar:/opt/jdk1.8.0_241/lib/tools.jar:/opt/weblogic/12.2.1.4.0/wlserver/modules/features/wlst.wls.classpath.jar: . PATH=/opt/weblogic/12.2.1.4.0/user_projects/domains/ltsDOMAIN/bin:/opt/weblogic/12.2.1.4.0/wlserver/server/bin:/opt/weblogic/12.2.1.4.0/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/opt/jdk1.8.0_241/jre/bin:/opt/jdk1.8.0_241/bin:/opt/jdk1.8.0_241/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/weblogic/.local/bin:/opt/weblogic/bin:/opt/weblogic/12.2.1.4.0/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin . *************************************************** * To start WebLogic Server, use a username and * * password assigned to an admin-level user. For * * server administration, use the WebLogic Server * * console at http://hostname:port/console * *************************************************** Starting WLS with line: /opt/jdk1.8.0_241/bin/java -server -Xms256m -Xmx512m -XX:CompileThreshold=8000 -cp /opt/weblogic/12.2.1.4.0/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/opt/weblogic/12.2.1.4.0/wlserver/server/lib/weblogic.policy -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/opt/weblogic/12.2.1.4.0/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/opt/weblogic/12.2.1.4.0/wlserver/server -Dweblogic.home=/opt/weblogic/12.2.1.4.0/wlserver/server weblogic.Server ... ... ...

    Open WebLogic Server Administration Console

    • Open the browser and enter following URL to open WebLogic Server Administration Console
    • http://192.168.50.87:7001/console/
      Login as user "weblogic" and password "Test1234".
      These credentials we defined while creating the domain. These must be changed after initial setup.
    • WebLogic Server Administration Console Admin page.
    • WebLogic Server Install and Configuration is complete.