Linux 系统 部署weblogic(新手版)
一、
1、如果原环境有jdk则需要卸载。
先用命令查看
rpm -qa|grep java 如果有jdk则需要卸载
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.191-2.6.15.5.el7.x86_64
rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.181-7.b13.el7.x86_64
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64
rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.191-2.6.15.5.el7.x86_64
卸载完成,安装新的jdk,将jdk上传到服务器上
cd /usr/local
解压并修改名称
mv jdk1.8.0_333/ java
配置jdk环境变量
vi /etc/profile
JAVA_HOME=/usr/local/java
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
[root@localhost local]# source /etc/profile
[root@localhost local]# java -version
java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)
二、
2、创建用户组
groupadd weblogic
创建 scrm 用户
useradd -g weblogic scrm
设置 scrm 用户密码
passwd scrm
在/opt目录下创建weblogic文件夹
cd /opt/
mkdir weblogic
[root@localhost local]# su scrm
[scrm@localhost local]$
cd /opt/weblogic/
把weblogic安装包上传到此目录
[scrm@localhost weblogic]$ ll
total 1043464
-rw-r--r--. 1 root root 1068506707 Jun 6 00:50 wls1036_generic.jar
[scrm@localhost weblogic]$ java -jar wls1036_generic.jar
Unable to instantiate GUI, defaulting to console mode.
Extracting 0%....................................................................................................100%
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Welcome:
--------
This installer will guide you through the installation of WebLogic 10.3.6.0.
Type "Next" or enter to proceed to the next prompt. If you want to change data entered previously, type "Previous". You may quit the installer at any time by typing "Exit".
1 Enter [Exit][Next]> next
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Choose Middleware Home Directory:
---------------------------------
"Middleware Home" = [Enter new value or use default
"/home/scrm/Oracle/Middleware"]
2 Enter new Middleware Home OR [Exit][Previous][Next]> next
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Register for Security Updates:
------------------------------
Provide your email address for security updates and to initiate configuration manager.
1|Email:[]
2|Support Password:[]
3|Receive Security Update:[Yes]
3 Enter index number to select OR [Exit][Previous][Next]> 3
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Register for Security Updates:
------------------------------
Provide your email address for security updates and to initiate configuration manager.
"Receive Security Update:" = [Enter new value or use default "Yes"]
4 Enter [Yes][No]? no
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Register for Security Updates:
------------------------------
Provide your email address for security updates and to initiate configuration manager.
"Receive Security Update:" = [Enter new value or use default "Yes"]
** Do you wish to bypass initiation of the configuration manager and
** remain uninformed of critical security issues in your configuration?
5 Enter [Yes][No]? yes
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Register for Security Updates:
------------------------------
Provide your email address for security updates and to initiate configuration manager.
1|Email:[]
2|Support Password:[]
3|Receive Security Update:[No]
6 Enter index number to select OR [Exit][Previous][Next]> next
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Choose Install Type:
--------------------
Select the type of installation you wish to perform.
->1|Typical
| Install the following product(s) and component(s):
| - WebLogic Server
| - Oracle Coherence
2|Custom
| Choose software products and components to install and perform optional
|configuration.
7 Enter index number to select OR [Exit][Previous][Next]> next
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
JDK Selection (Any * indicates Oracle Supplied VM):
---------------------------------------------------
JDK(s) chosen will be installed. Defaults will be used in script string-substitution if installed.
1|Add Local Jdk
2|/usr/local/java[x]
*Estimated size of installation: 690.2 MB
8 Enter 1 to add or >= 2 to toggle selection OR [Exit][Previous][Next]> next
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Choose Product Installation Directories:
----------------------------------------
Middleware Home Directory: [/home/scrm/Oracle/Middleware]
Product Installation Directories:
1|WebLogic Server: [/home/scrm/Oracle/Middleware/wlserver_10.3]
2|Oracle Coherence: [/home/scrm/Oracle/Middleware/coherence_3.7]
9 Enter index number to select OR [Exit][Previous][Next]> next
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
The following Products and JDKs will be installed:
--------------------------------------------------
WebLogic Platform 10.3.6.0
|_____WebLogic Server
| |_____Core Application Server
| |_____Administration Console
| |_____Configuration Wizard and Upgrade Framework
| |_____Web 2.0 HTTP Pub-Sub Server
| |_____WebLogic SCA
| |_____WebLogic JDBC Drivers
| |_____Third Party JDBC Drivers
| |_____WebLogic Server Clients
| |_____WebLogic Web Server Plugins
| |_____UDDI and Xquery Support
| |_____Evaluation Database
|_____Oracle Coherence
|_____Coherence Product Files
*Estimated size of installation: 690.3 MB
10 Enter [Exit][Previous][Next]> next
Jun 06, 2022 10:32:21 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Installing files..
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
Performing String Substitutions...
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Configuring OCM...
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
Creating Domains...
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
Installation Complete
Congratulations! Installation is complete.
11 Press [Enter] to continue or type [Exit]> exit
-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------
<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->
三、
Clean up process in progress ...
[scrm@localhost weblogic]$ cd /home/scrm/Oracle/Middleware/wlserver_10.3/common/bin/
[scrm@localhost bin]$ ll
total 112
-rwxr-x---. 1 scrm weblogic 22805 Jun 6 22:32 commEnv.sh
-rwxr-x---. 1 scrm weblogic 2125 Jun 6 22:32 config_builder.sh
-rwxr-x---. 1 scrm weblogic 2277 Jun 6 22:32 config.sh
-rwxr-x---. 1 scrm weblogic 2582 Jun 6 22:32 pack.sh
-rwxr-x---. 1 scrm weblogic 2150 Jun 6 22:32 setPatchEnv.sh
-rwxr-x---. 1 scrm weblogic 4085 Jun 6 22:32 startDerby.sh
-rwxr-x---. 1 scrm weblogic 4091 Jun 6 22:32 startManagedWebLogic.sh
-rwxr-x---. 1 scrm weblogic 1451 Jun 6 22:32 stopDerby.sh
-rwxr-x---. 1 scrm weblogic 2090 Jun 6 22:32 unpack.sh
-rwxr-x---. 1 scrm weblogic 3301 Jun 6 22:32 upgrade.sh
-rwxr-x---. 1 scrm weblogic 31220 Jun 6 22:32 wlscontrol.sh
-rwxr-x---. 1 scrm weblogic 13740 Jun 6 22:32 wlsifconfig.sh
-rwxr-x---. 1 scrm weblogic 787 Jun 6 22:32 wlst.sh
[scrm@localhost bin]$ ./config.sh
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Unable to instantiate GUI, defaulting to console mode.
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/scrm/Oracle/Middleware/wlserver_10.3/common/lib/libjni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
<------------------- Fusion Middleware Configuration Wizard ------------------>
Welcome:
--------
Choose between creating and extending a domain. Based on your selection,
the Configuration Wizard guides you through the steps to generate a new or
extend an existing domain.
->1|Create a new WebLogic domain
| Create a WebLogic domain in your projects directory.
2|Extend an existing WebLogic domain
| Use this option to add new components to an existing domain and modify |configuration settings.
1 Enter index number to select OR [Exit][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select Domain Source:
---------------------
Select the source from which the domain will be created. You can create the
domain by selecting from the required components or by selecting from a
list of existing domain templates.
->1|Choose Weblogic Platform components
| You can choose the Weblogic component(s) that you want supported in
|your domain.
2|Choose custom template
| Choose this option if you want to use an existing template. This
|could be a custom created template using the Template Builder.
2 Enter index number to select OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Application Template Selection:
-------------------------------
Available Templates
|_____Basic WebLogic Server Domain - 10.3.6.0 [wlserver_10.3]x
|_____Basic WebLogic SIP Server Domain - 10.3.6.0 [wlserver_10.3] [2]
|_____WebLogic Advanced Web Services for JAX-RPC Extension - 10.3.6.0 [wlserver_10.3] [3]
|_____WebLogic Advanced Web Services for JAX-WS Extension - 10.3.6.0 [wlserver_10.3] [4]
Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Edit Domain Information:
------------------------
| Name | Value |
_|________|_____________|
1| *Name: | base_domain |
3 Enter value for "Name" OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select the target domain directory for this domain:
---------------------------------------------------
"Target Location" = [Enter new value or use default
"/home/scrm/Oracle/Middleware/user_projects/domains"]
4 Enter new Target Location OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *Name: | weblogic |
2| *User password: | |
3| *Confirm user password: | |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
5 Enter option number to select OR [Exit][Previous][Next]> 2
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
"*User password:" = []
6 Enter new *User password: OR [Exit][Reset][Accept]> scrm@123
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *Name: | weblogic |
2| *User password: | ******** |
3| *Confirm user password: | |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
5 - Discard Changes
** CFGFWK-64018: The confirmed password does not match the entered one.
7 Enter option number to select OR [Exit][Previous][Next]> 3
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
"*Confirm user password:" = []
Enter new *Confirm user password: OR [Exit][Reset][Accept]> scrm@123
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *Name: | weblogic |
2| *User password: | ******** |
3| *Confirm user password: | ******** |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
5 - Discard Changes
8 Enter option number to select OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Domain Mode Configuration:
--------------------------
Enable Development or Production Mode for this domain.
->1|Development Mode
2|Production Mode
9 Enter index number to select OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Java SDK Selection:
-------------------
->1|Sun SDK 1.8.0_333 @ /usr/local/java
2|Other Java SDK
10 Enter index number to select OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select Optional Configuration:
------------------------------
1|Administration Server [ ]
2|Managed Servers, Clusters and Machines [ ]
3|RDBMS Security Store [ ]
11 Enter index number to select OR [Exit][Previous][Next]> 1
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select Optional Configuration:
------------------------------
1|Administration Server [x]
2|Managed Servers, Clusters and Machines [ ]
3|RDBMS Security Store [ ]
12 Enter index number to select OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure the Administration Server:
------------------------------------
Each WebLogic Server domain must have one Administration Server. The
Administration Server is used to perform administrative tasks.
| Name | Value |
_|__________________|_____________________|
1| *Name: | AdminServer |
2| *Listen address: | All Local Addresses |
3| Listen port: | 7001 |
4| SSL listen port: | N/A |
5| SSL enabled: | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
13 Enter option number to select OR [Exit][Previous][Next]> next
<------------------- Fusion Middleware Configuration Wizard ------------------>
Creating Domain...
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
**** Domain Created Successfully! ****
至此weblogic安装成功
四、
启动 domain
[scrm@localhost bin]$ cd
/home/scrm/Oracle/Middleware/user_projects/domains/base_domain/bin/
[scrm@localhost bin]$ ll
total 36
drwxr-x---. 2 scrm weblogic 27 Jun 6 22:36 nodemanager
drwxr-x---. 2 scrm weblogic 28 Jun 6 22:36 server_migration
drwxr-x---. 2 scrm weblogic 24 Jun 6 22:36 service_migration
-rwxr-x---. 1 scrm weblogic 13236 Jun 6 22:36 setDomainEnv.sh
-rwxr-x---. 1 scrm weblogic 3221 Jun 6 22:36 startManagedWebLogic.sh
-rwxr-x---. 1 scrm weblogic 5695 Jun 6 22:36 startWebLogic.sh
-rwxr-x---. 1 scrm weblogic 2446 Jun 6 22:36 stopManagedWebLogic.sh
-rwxr-x---. 1 scrm weblogic 1988 Jun 6 22:36 stopWebLogic.sh
[scrm@localhost bin]$ ./startWebLogic.sh
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=256m
.
WLS Start Mode=Development
.
CLASSPATH=/home/scrm/Oracle/Middleware/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/scrm/Oracle/Middleware/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/local/java/lib/tools.jar:/home/scrm/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/scrm/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/scrm/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.6.0.jar:/home/scrm/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/scrm/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/scrm/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/home/scrm/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/home/scrm/Oracle/Middleware/wlserver_10.3/server/lib/xqrl.jar:.:/usr/local/java/lib.tools.jar
.
PATH=/home/scrm/Oracle/Middleware/wlserver_10.3/server/bin:/home/scrm/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/usr/local/java/jre/bin:/usr/local/java/bin:/usr/local/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
.
***************************************************
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http://hostname:port/console *
***************************************************
starting weblogic with Java version:
java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)
Starting WLS with line:
.........省略
<Jun 6, 2022 10:37:21 PM PDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<Jun 6, 2022 10:37:21 PM PDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
开放7001端口
firewall-cmd --zone=public --add-port=7001/tcp --permanent
success
[root@localhost ~]#
firewall-cmd --reload
success
[root@localhost ~]#
firewall-cmd --list-all
登录网页验证
http://192.168.31.33:7001/console/login/LoginForm.jsp
------------------------------------------------------------------------------------------------
---------------------------------------配置weblogic开机自启-----------------------------------
第一种方法
crontab 是Linux的计划任务,可以设置为 @reboot当服务器重启后执行某个命令
$ crontab -e
设置
@reboot /home/scrm/Oracle/Middleware/user_projects/domains/base_domain/bin/startWebLogic.sh
第二种方法:
1、创建WebLogic启动脚本
以root用户登录,执行如下命令,创建启动脚本:
# cd /etc/rc.d/init.d/
# vi weblogic
脚本中添加一下内容:
#!/bin/bash
# description: Weblogic Server auto start/stop script
# /etc/rc.d/init.d/weblogic
# chkconfig: 2345 10 90
# description: weblogic
# Please edit the variable
export BEA_BASE=/home/scrm/Oracle/Middleware
export BEA_HOME=$BEA_BASE/user_projects/domains/base_domain
export BEA_LOG=$BEA_BASE/weblogic.log
export PATH=$PATH:$BEA_HOME
#weblogic的用户名
BEA_OWNR="scrm"
# if the executables do not exist
if [ ! -f $BEA_HOME/startWebLogic.sh -o ! -d $BEA_HOME ]
then
echo "WebLogic startup: cannot start"
exit 1
fi
# depending on parameter
case "$1" in
start)
echo -n "Starting WebLogic,log file $BEA_LOG: "
touch /var/lock/weblogic
su $BEA_OWNR -c "cd ${BEA_HOME}; nohup ./startWebLogic.sh > $BEA_LOG 2>&1 &"
echo "OK"
;;
stop)
echo -n "Shutdown WebLogic: "
rm -f /var/lock/weblogic
su $BEA_OOWNR -c "cd ${BEA_HOME}/bin; ./stopWebLogic.sh >> $BEA_LOG"
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
问题处理:
1、如果在启动时出现如下错误,则是因为用root用户启动了domain,再切换到weblogic用户启动就会报错,
java.lang.ClassCastException: com.octetstring.vde.backend.BackendRoot cannot be cast to com.octetstring.vde.backend.standard.BackendStandard
at weblogic.ldap.EmbeddedLDAP.start(EmbeddedLDAP.java:303)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
解决方法,给文件授权
chown -h -R 用户名 文件夹 例子: chown -h -R scrm /home/scrm