WebLogic是美国Oracle公司出品的一个applicationserver,确切的说是一个基于JAVAEE架构的中间件,WebLogic是用于开发、集成、部署和管理大型分布式Web应用、网络应用和数据库应用的Java应用服务器。将Java的动态功能和Java Enterprise标准的安全性引入大型网络应用的开发、集成、部署和管理之中。
WebLogic是美商Oracle的主要产品之一,系并购BEA得来。是商业市场上主要的Java(J2EE)应用服务器软件(application server)之一,是世界上第一个成功商业化的J2EE应用服务器,已推出到12c(12.1.3) 版。而此产品也延伸出WebLogic Portal,WebLogicIntegration等企业用的中间件(但当下Oracle主要以Fusion Middleware融合中间件来取代这些WebLogicServer之外的企业包),以及OEPE(Oracle Enterprise Pack for Eclipse)开发工具。
server | 192.168.1.158 |
os | rhel 7.2 |
weblogic | 12c |
java | 1.8.0_151 |
Weblogic下载地址:http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html
jdk8 下载地址: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
1、初始化系统
# vi /etc/selinux/config
SELINUX=disabled |
# systemctl disable firewalld
# hostnamectl set-hostname ceshi.desktop
# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ceshi.desktop ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 |
# yum groupinstall -y "Server with GUI"
# systemctl set-default graphical.target
# reboot
2、安装 jdk8
# rpm -qa| grep java
# rpm -e xxx --nodeps
# cd /usr/local/src
# rpm -ivh jdk-8u151-linux-x64.rpm
# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_151/ export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin |
# source/etc/profile
# java -version
java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode) |
# echo $JAVA_HOME
/usr/java/jdk1.8.0_151/ |
3、安装 Weblogic 12c
# unzip wls1213_dev.zip
# cd wls12130
# more README.txt # jdk版本符合要求
This version of WLS requires JDK 1.7 as a minimum. Ensure that you have the proper JDK version installed and ready for use. |
# pwd
/usr/local/src/wls12130 |
# echo "export MW_HOME=/usr/local/src/wls12130" >> /etc/profile
# source/etc/profile
#./configure.sh
************************************************** WebLogic Server 12g (12.1.3.0) Zip Configuration
MW_HOME: /usr/local/src/wls12130 JAVA_HOME: /usr/java/jdk1.8.0_151/ **************************************************
Please wait while 740 jars are unpacked ... Unpacking com.oracle.state-management.persistence-service-provider-state-management-impl_12.1.3.jar 5Unpacking com.oracle.state-management.state-management-provider-common-internal-api_12.1.3.jar 526 to...Unpacking done 0 to go
BUILD SUCCESSFUL Total time: 0 seconds CLASSPATH=/usr/java/jdk1.8.0_151//lib/tools.jar:/usr/local/src/wls12130/wlserver/server/lib/weblogic_sp.jar:/usr/local/src/wls12130/wlserver/server/lib/weblogic.jar:/usr/local/src/wls12130/oracle_common/modules/net.sf.antcontrib_1.1.0.0_1-0b3/lib/ant-contrib.jar:/usr/local/src/wls12130/wlserver/modules/features/oracle.wls.common.nodemanager_2.0.0.0.jar:.:/usr/java/jdk1.8.0_151//lib/dt.jar:/usr/java/jdk1.8.0_151//lib/tools.jar
PATH=/usr/local/src/wls12130/wlserver/server/bin:/usr/local/src/wls12130/oracle_common/modules/org.apache.ant_1.9.2/bin:/usr/java/jdk1.8.0_151//jre/bin:/usr/java/jdk1.8.0_151//bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.8.0_151//bin:/usr/java/jdk1.8.0_151//bin:/usr/local/src/wls12130/oracle_common/modules/org.apache.maven_3.0.5/bin
Your environment has been set. Configuring WLS...
BUILD SUCCESSFUL Total time: 0 seconds
Do you want to configure a new domain? [y/n]? n |
# 这个时候切换到图形界面
#cd /usr/local/src/wls12130/wlserver/common/bin
# ./config.sh
4、启动 Weblogic
# cd /usr/local/src/wls12130/user_projects/domains/base_domain/bin
# vi startWebLogic.sh # 为了以后免输入用户名密码
WLS_USER=weblogic WLS_PW=weblogic123 |
# vi stopWebLogic.sh
WLS_USER=weblogic WLS_PW=weblogic123 |
# cd ..
# ./startWebLogic.sh # 观察log输出
# nohup ./startWebLogic.sh & # 后台执行方式
WEB 登录 http://192.168.1.158:7001/console
# 发布过程:
参考 <http://blog.chinaunix.net/uid-28756827-id-4756399.html>
先将war上传到/usr/local/src/wls12130/user_projects/domains/base_domain/下
点击左上角的“锁定并编辑“----->左边框内的”部署“-----》安装-----》选择要发布的war包---->点击下一步,如果出错,一般都是因为web.xml的原因,一直下一步---》完成之后。左上角的“激活更改”--》现在部署的项目是“准备就绪”状态---》将要部署的项目点击前面小框,将小框勾上,然后“启动”,状态切换到“活动”状态。就可以通过ip:端口/项目名访问到项目了。