Archive for 2021年12月8日


WEBLOGIC从单个模板创建域脚本

# 调用WLST来执行.py脚本
# source /$DOMAIN_HOME/bin/setDomainEnv.sh
# java weblogic.WLST xxx.py

# Read the template to use for creating the domain
readTemplate(‘oracle_home/middleware/wlserver/common/templates/wls/wls.jar’)

# Set the listen address and listen port for the Administration Server
cd(‘Servers/AdminServer’)
set(‘ListenAddress’,”)
set(‘ListenPort’, 7001)

# Enable SSL on the Administration Server and set the SSL listen address and port
create(‘AdminServer’,’SSL’)
cd(‘SSL/AdminServer’)
set(‘Enabled’, ‘True’)
set(‘ListenPort’, 7002)

# Set the domain password for the WebLogic Server administration user
cd(‘/’)
cd(‘Security/base_domain/User/’adminusername’)
cmo.setPassword(‘adminpassword’)

# If the domain already exists, overwrite the domain
setOption(‘OverwriteDomain’, ‘true’)

# write the domain and close the template
writeDomain(‘/domains/mydomain’)
closeTemplate()

exit()

廣告

# 调用WLST来执行.py脚本
# source $DOMAIN_HOME/bin/setDomainEnv.sh
# java weblogic.WLST xxx.py

connect(“weblogic”,”weblogic21″,”t3://127.0.0.1:7001″)
edit()
startEdit()

cd(‘/SecurityConfiguration/’+domainName);

cmo.setConnectionFilter(‘weblogic.security.net.ConnectionFilterImpl’)

set(‘ConnectionFilterRules’,jarray.array([String(‘10.0.0.0/8 * * allow t3 t3s’),String(‘127.0.0.1 * * allow t3 t3s’),String(‘* * 7001 deny t3 t3s’)],String))

save()
activate()

# 调用WLST来执行.py脚本
# source /$DOMAIN_HOME/bin/setDomainEnv.sh
# java weblogic.WLST xxx.py

connect(username=”weblogic”,password=”weblogic21″,url=”t3://127.0.0.1:7001″)

domainConfig()
edit()
startEdit()

servers=cmo.getServers()
for server in servers:
cd(‘/Servers/’ + server.getName())
cmo.setIIOPEnabled(false)

save()
activate()
disconnect()
exit()