搭建Linux项目环境(六)-安装weblogic 12c

1、下载weblogic 12c官方文档,如下:

在这里插入图片描述

2、解压下载后的包,README.txt里面有安装说明,英文好的可以直接按照说明安装,安装包运行需要JDK8以上支持

在这里插入图片描述

3、建立weblogic的相关用户和组

# 创建weblogic组
sudo groupadd weblogic

# 创建weblogic用户并指定组
sudo useradd -mg weblogic weblogic

# 修改weblogic密码
sudo passwd weblogic

#创建weblogic目录
sudo mkdir -p /weblogic
sudo chown weblogic:weblogic /weblogic

#切换用户
su - weblogic

4、上传fmw_12.2.1.3.0_wls_quick.jar到ubuntu,如/weblogic

在这里插入图片描述

5、安装weblogic

  • cd /weblogic 运行java -jar fmw_12.2.1.3.0_wls_quick.jar进行安装,安装成功,如下
    在这里插入图片描述

6、配置weblogic应用域(图形界面方式)

  • 6.1 运行/weblogic/wls12213/wlserver/server/bin下的setWLSEnv.sh设置weblogic环境变量
    在这里插入图片描述
  • 6.2 运行mkdir -p /weblogic/user_projects/domains,创建/weblogic/user_projects/domains
  • 6.3 运行. <WL_HOME>/oracle_common/common/bin/config.sh配置weblogic域,需要图形界面支持,不然打不开,界面如下,选“Create a new domain”,Domain Location可以选默认,也可以选上面创建的/weblogic/user_projects/domains/fdm_domain,然后点"Next"
    在这里插入图片描述
  • 6.4 默认,然后点"Next"
    在这里插入图片描述
  • 6.5 输入weblogic管理员用户和密码,建议用户是weblogic,密码长度8位以上,如weblogic123,然后点"Next"
    在这里插入图片描述
  • 6.6 选择模式,有Development模式(开发模式)和Production模式(生产模式),

两种模式区别如下

  • 开发模式的用户名和密码配置在boot.properties中,启用了自动部署,当自动部署处于启用状态时,管理服务器将监视指定的目录以确定是否有新建的或更新的应用程序。如果管理服务器发现了应用程序有变化,就会自动部署该目录中的所有文件或目录。默认情况下,自动部署目录为域的/autodeploy子目录,在autodeploy目录中找到的任何新文件都将被自动部署。
  • 生产模式关闭了自动部署,启动应用时需要输入用户名和密码,当然也可以配个boot.properties。

两种模式互相转换的方法

  • 生产模式开发模式
    第一步:将domain下的/bin/setDomainEnv.sh文件的PRODUCTION_MODE="true"改为PRODUCTION_MODE="false"或者PRODUCTION_MODE=。
    第二步:将domain下的config/config.xml文件中的<production-mode-enabled>true</production-mode-enabled>改为<production-mode-enabled>false</production-mode-enabled>,或者直接删掉。
    第三步:重新运行/bin/startWebLogic.sh即可。
  • 开发模式生产模式
    第一步:将domain下的bin/setDomainEnv.sh文件中的PRODUCTION_MODE="false"改为PRODUCTION_MODE=“true”。
    第二步:重新运行/bin/startWebLogic.sh即可。

选开发模式及JDK,然后点"Next"
在这里插入图片描述

  • 6.7 选"Administration Server",然后点"Next"
    在这里插入图片描述

  • 6.8 填上服务器名,IP和端口,点"Next"
    在这里插入图片描述

  • 6.9 配置结果预览,点"Create"创建
    在这里插入图片描述

  • 6.10 正在创建,出现100%就可以了。然后点"Next"
    在这里插入图片描述

  • 6.11 点"Finish"退出,记住Admin Server URL
    在这里插入图片描述

  • 6.12 运行mkdir -p /weblogic/start/logs,创建weblogic启动脚本及日志目录。

新建一个startFdmAdmin.sh,输入以下内容

nohup /weblogic/user_projects/domains/fdm_domain/bin/startWebLogic.sh>/weblogic/start/logs/startfdmAdmin.out &
tail -f /weblogic/start/logs/startfdmAdmin.out
cd /weblogic/start
sh startFdmAdmin.sh

当出现RUNNING时表示启动成功,如下
在这里插入图片描述

  • 6.14 打开浏览器输入http://11.1.2.8:7001/console,输入上面设置的密码,如下
    在这里插入图片描述
    登录成功的界面如下
    在这里插入图片描述

7、配置weblogic应用域(使用WebLogic Scripting Tool (WLST)脚本方式)

  • 7.1 创建的域目录
mkdir -p /weblogic/user_projects/domains
  • 7.2 复制basicWLSDomain.py到/weblogic/user_projects/domains
cp /weblogic/wls12213/wlserver/common/templates/scripts/wlst/basicWLSDomain.py /weblogic/user_projects/domains
#=======================================================================================
# Open a domain template.
#=======================================================================================

readTemplate("/weblogic/wls12213/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','')
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('weblogic123')

#=======================================================================================
# Write the domain and close the domain template.
#=======================================================================================

setOption('OverwriteDomain', 'true')
writeDomain('/weblogic/user_projects/domains/basicWLSDomain')
closeTemplate()

#=======================================================================================
# Exit WLST.
#=======================================================================================

exit()
  • 7.4 执行以下命令,然后等待完成即可(大约15分钟左右)
cd /weblogic/user_projects/domains 
sh /weblogic/wls12213/oracle_common/common/bin/wlst.sh basicWLSDomain.py

在这里插入图片描述

  • 7.5 启动域
cd basicWLSDomain
sh startWebLogic.sh
  • 7.6 启动完成后打开浏览器输入http://11.1.2.8:7001/console,输入上面设置的密码即可
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值