Linux命令行安装weblogic12.1.3

This version of WLS requires JDK 1.7 as a minimum.

此版本的weblogic至少需要JDK 1.7。

1.下载weblogic

下载weblogic12.1.3版本,选择Zip distribution for Mac OSX, Windows, and Linux,将下载的wls1213_dev.zip上传到Linux系统

Zip distribution with Oracle WebLogic Server only and intended for WebLogic Server development only.
zip的包仅分配Oracle WebLogic Server并且仅用于WebLogic Server开发环境。

PATCHING
——–
Installations based on the WebLogic Zip Distribution cannot be patched. If you require a patch, you must install WebLogic using a full distribution, and then use OPatch to apply the required patch.
基于Weblogic Zip Distribution的zip安装包不能安装补丁。如果你需要安装补丁,你必须安装WebLogic使用全分布方式,然后用OPatch申请所需的补丁。

意思是如果在开发环境中使用WebLogic选择zip包进行安装,而且zip安装包不支持打补丁;如果在生产环境使用WebLogic需要下载Generic通用包安装使用
将下载的fmw_12.1.3.0.0_wls.jar上传到Linux系统,具体安装步骤请参见 Linux命令行安装weblogic12c

2.解压到安装目录

  1. 进入安装包上传路径,解压unzip wls1213_dev.zip

  2. 创建weblogic安装目录

    mkdir /usr/local/weblogic12c

  3. 移动解压文件到weblogic安装目录

    mv wls12130/ /usr/local/weblogic12c/

3.准备安装环境

  1. 配置安装环境

    在用户主目录下vi .bash_profile,这个文件不一定存在,如果存在,就在~/,即~/.bash_profile。但也很可能不存在,这时创建一个空文件,加入自己想要的内容就行。Linux中的配置文件很多都是这样,是要在需要时建立的,而程序在没有这些配置文件时,也可能正常运行。

    cd ~/    -- 进入用户主目录下
    vi .bash_profile    -- 修改文件,若没有则是新增
    export JAVA_HOME=/usr/local/jdk1.7.0_80
    export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
    export PATH=$JAVA_HOME/bin:$PATH
    
    export MW_HOME=/usr/local/weblogic12c/wls12130

    source .bash_profile使配置立即生效

  2. 配置主机名和IP的映射

    若不配置,会报UnknownHostException

    vi /etc/hosts,添加配置项192.168.1.200 cyyun

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    
    192.168.1.200  cyyun

4.运行安装配置脚本

Run the installation configuration script in the MW_HOME directory.

This step is required to be run only once. If you move the installation to another location/machine, you need to rerun this step.

在MW_HOME目录中运行安装配置脚本。

此步骤仅需运行一次。 如果您将安装移动到另一个位置/机器,您需要重新运行此步骤。

cd $MW_HOME
./configure.sh -silent

5.设置环境

Setup WLS environment in the current shell.

cd $MW_HOME/wlserver/server/bin/
./setWLSEnv.sh

6.创建域,控制台启动慢问题

现象:
1. 创建域的时候writeDomain需要很长时间(20分钟左右)
2. 启动weblogic第一次进入控制台需要很长时间(10分钟左右)
3. 启动weblogic server需要很长时间(5-10分钟)

修改:
在创建域之前,先修改Linux下的Java生成随机数

cd $JAVA_HOME/jre/lib/security
vi java.security

# securerandom.source=file:/dev/urandom
# 修改为
# securerandom.source=file:/dev/./urandom

7.创建Domain/域

mkdir /usr/local/weblogic12c/domain    -- 创建域存放目录
cd $MW_HOME/wlserver/common/bin
./commEnv.sh
./wlst.sh 

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

wls:/offline>readTemplate('/usr/local/weblogic12c/wls12130/wlserver/common/templates/wls/wls.jar')
wls:/offline/base_domain>cd('Servers/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','')
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('weblogic12c')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain', 'true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/usr/local/weblogic12c/domain')
wls:/offline/domain/Security/domain/User/weblogic>closeTemplate()
wls:/offline>exit()


Exiting WebLogic Scripting Tool.

其中writeDomain要等待挺长时间

8.启动weblogic

cd /usr/local/weblogic12c/domain/bin/    -- 进入创建的域目录bin下
./startWebLogic.sh    -- 后台启动使用nohup ./startWebLogic.sh &
./stopWeblogic.sh    -- 关闭weblogic

启动浏览器访问weblogic控制台http://IP:7001/console,用户名默认是weblogic,密码是创建域时设置的。

9.新建server启动

应用默认运行在AdminServer中,如果用控制台新建了server,比如名为cyyunServer,命令行启动cyyunServer,用startManagedServer命令startManagedServer <server名> <控制台的地址+端口>

cd /usr/local/weblogic12c/domain/bin
./startManagedWebLogic.sh cyyunServer http://localhost:7001

刷新控制台页面cyyunServer显示启动成功。

10.不输入用户名密码启动server

启动weblogic server需要在控制台输入用户名和密码,不方便后台启动

cd /usr/local/weblogic12c/domain/servers/cyyunServer
mkdir security
cd security
vi boot.properties

# 填入以下内容
username=weblogic
password=weblogic12c

cd /usr/local/weblogic12c/domain/bin
# 关闭cyyunServer
./stopManagedWebLogic.sh cyyunServer http://localhost:7001
# 重新启动cyyunServer
./startManagedWebLogic.sh cyyunServer http://localhost:7001
# 后台启动
nohup ./startManagedWebLogic.sh cyyunServer http://localhost:7001 &

此时不再需要手动输入用户名和密码,同时不用担心密码会泄漏,启动后Weblogic会对用户名和密码做AES加密。再次打开boot.properties就会显示加密后的内容。

本文参考:
https://my.oschina.net/CasparLi/blog/420210
Weblogic服务启动和关闭慢的问题参考:
http://www.2cto.com/kf/201312/262378.html
http://blog.csdn.net/rznice/article/details/19164977
http://www.cnblogs.com/sprinng/p/5810679.html

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值