weblogc 12.2.1.3 版本在CentOS安装教程
(注:1.教程所需资源到相应官网下载;2.教程中路径根据你自己实际系统路径和需求修改,执行相关指令注意按照提示文字修改)
1.新建和编辑必要文件
- 创建wls.rsp且文件内容如下:
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/home/oracle/weblogic/wls12213
#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.
INSTALL_TYPE=WebLogic Server
#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.
MYORACLESUPPORT_USERNAME=
#Provide the My Oracle Support Password
MYORACLESUPPORT_PASSWORD=<SECURE VALUE>
#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true
#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
#Provide the Proxy Host
PROXY_HOST=
#Provide the Proxy Port
PROXY_PORT=
#Provide the Proxy Username
PROXY_USER=
#Provide the Proxy Password
PROXY_PWD=<SECURE VALUE>
#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port]
COLLECTOR_SUPPORTHUB_URL=
- 创建oraInst.loc文件且内容如下:
inventory_loc=/home/oracle/weblogic/oraInventory
inst_group=weblogic
- 创建install.sh文件且内容如下:
#!/bin/bash
java -jar fmw_12.2.1.3.0_wls.jar -silent -responseFile /home/oracle/weblogic/wls.rsp -invPtrLoc /home/oracle/weblogic/oraInst.loc
- 创建init_domains.sh文件且内容如下:
#!/bin/bash
export MW_HOME="/home/oracle/weblogic/wls12213"
export WL_HOME="/home/oracle/weblogic/wls12213/oracle_common"
cd /home/oracle/weblogic/wls12213/oracle_common/common/bin
./commEnv.sh
./wlst.sh
2.检验环境和安装
- 安装java环境1.8版本以上;要安装的时oracle的jdk,不能是openJDK版本的
- 执行install.sh安装weblogic server
- 执行init_domains.sh初始化domains域
- 执行完第三步之后进入wls脚本命令行模式,依次按照下面的列子执行即可
wls:/offline> readTemplate('/home/oracle/weblogic/wls12213/wlserver/common/templates/wls/wls.jar')
会出现警告(可以不用管):警告: readTemplate 已过时。在 selectTemplate 后请使用 loadTemplates 以取代 readTemplate。
wls:/offline/base_domain>cd('Servers/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','监听的ip,填写你要监听的ip,默认地址可置空串即可')
wls:/offline/base_domain/Server/AdminServer>set('ListenPort', 7001)
wls:/offline/base_domain/Server/AdminServer>cd('../..')
wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')
wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic123')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain', 'true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/home/oracle/weblogic/wls12213/user_projects/domains/base_domain')
wls:/offline/base_domain/Security/base_domain/User/weblogic>closeTemplate()
wls:/offline>exit()
- 执行成功后,domain路径在:
cd /home/oracle/weblogic/wls12213/user_projects/domains/base_domain - 启动服务:
./startWebLogic.sh - 访问控制台地址:http://服务器ip:7001/console
通过配置config.xml方式发布应用教程:
- 修改base_domain/config/config.xml文件如下:在AdminServer的
<server>...</server>标签后面添加你自己的server标签例如:
<server>
<name>你的服务名</name>
<listen-port>你要发布的端口号,例如80</listen-port>
<web-server>
<web-server-log>
<number-of-files-limited>false</number-of-files-limited>
</web-server-log>
</web-server>
<listen-address></listen-address>
</server>
在configuration-version 和 admin-server-name 之间添加
<app-deployment>
<name>app服务名</name>
<target>你的服务名</target>
<module-type>dir</module-type>
<source-path>WebContent全路径</source-path>
<security-dd-model>DDOnly</security-dd-model>
<!--
<staging-mode xsi:nil="true"></staging-mode>
<plan-staging-mode xsi:nil="true"></plan-staging-mode>
<cache-in-app-directory>false</cache-in-app-directory>
-->
</app-deployment>
2.进入base_domain/bi目录下,./startManagedWeblogic.sh 你的服务名启动,直到出现输入weblogic管理员的用户和密码,把用户名和密码输入就能启动成功
3.如果不想在每次执行./startManagedWeblogic.sh启动服务时输入用户名和密码,可以用编辑器打开startManagedWeblogic.sh修改WLS_USER=weblogic管理员 WLS_PW=weblogic管理员密码
747

被折叠的 条评论
为什么被折叠?



