站在巨人的肩膀上
关于weblogic安装,主要的方式有两种,一种是console方式,还有一种就是silent方式,也就是静默安装。
part 1 安装依赖包
[root@localhost ~]# yum install openssl-devel compat-libstdc++-33
另外我们还需要安装jdk,我这里安装的是6u20的。
part 2 建立用户和群组
主要是添加群组oinstall 和用户weblogic,并设置密码。
[root@localhost ~]# groupadd -g 1000 oinstall
[root@localhost ~]# useradd -u 1200 -g oinstall weblogic
[root@localhost ~]# passwd weblogic
part 3 创建安装目录文件夹
[root@localhost ~]# mkdir -p /u01/app/oracle/middleware
[root@localhost ~]# mkdir -p /u01/app/oracle/config/domains
[root@localhost ~]# mkdir -p /u01/app/oracle/config/applications
[root@localhost ~]# mkdir -p /u01/software
[root@localhost ~]# chmod -R 775 /u01/
part 4 设置环境变量
在/home/weblogic/.bash_profile文件中添加相关的变量
[root@localhost ~]# vi /home/weblogic/.bash_profile
修改内容如下
export LANG=en_US
export MW_HOME=/u01/app/oracle/middleware
export WLS_HOME=$MW_HOME/wlserver_10.3
export WL_HOME=$WLS_HOME
# Set to the appropriate JAVA_HOME.
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH
part 5 silent.xml和静默安装
silent.xml是静默安装时需要的文件,需要自己编写,内容如下,主要是关于一些安装的路径,需要安装的服务类型等信息。
<?xml version="1.0" encoding="UTF-8"?>
<bea-installer>
<input-fields>
<data-value name="BEAHOME" value="/u01/app/oracle/middleware"/>
<data-value name="WLS_INSTALL_DIR" value="/u01/app/oracle/middleware/wlserver_10.3"/>
<data-value name="COMPONENT_PATHS" value="WebLogic Server"/>
<data-value name="INSTALL_NODE_MANAGER_SERVICE" value="yes"/>
<data-value name="NODEMGR_PORT" value="5556"/>
<data-value name="INSTALL_SHORTCUT_IN_ALL_USERS_FOLDER" value="no"/>
<data-value name="LOCAL_JVMS" value="/usr/local/java"/>
</input-fields>
</bea-installer>
然后进行静默安装,mode类型改为silent,silent_xml则指向刚才创建的silent.xml文件。
[root@localhost ~]# $JAVA_HOME/bin/java -Xmx1024m -jar /u01/software/wls1032_generic.jar -mode=silent -silent_xml=/u01/software/silent.xml
part 6 检验
查看一下weblogic 版本来查看是否已经安装成功
[root@localhost ~]# . $WLS_HOME/server/bin/setWLSEnv.sh
[root@localhost ~]# java weblogic.version
part 7 静默创建域domains
和安装时差不多,我们需要在配置之前,先写一个脚本,然后在进行静默安装。
主要是设置weblogic的安装目录,java的目录,adminServer端口设置,监听端口设置,以及用户名和密码的设置。
[root@localhost ~]# vim domain_silent.rsp
read template from "/u01/app/oracle/middleware/wlserver_10.3/common/templates/domains/wls.jar";
set JavaHome "/usr/local/java"; //Set JDK to use
set ServerStartMode "dev"; //production mode or development mode
//To create a Admin server find it from wls template
find Server "AdminServer" as AdminServer;
set AdminServer.ListenAddress "192.168.10.152";
set AdminServer.ListenPort "7001";
set AdminServer.SSL.Enabled "true";
set AdminServer.SSL.ListenPort "7002";
//We can directly create a new managed server.
create Server "ms1" as MS1;
set MS1.ListenAddress "192.168.10.152";
set MS1.ListenPort "7003";
//set MS1.SSL.Enabled "true";
//set MS1.SSL.ListenPort "7004″;
//Craeting Cluster
//create Cluster "MyCluster" as MyCl;
//Putting managed servers into the cluster
//assign Server "MS1″ to Cluster "MyCluster";
//assign Server "MS2″ to Cluster "MyCluster";
//Create Machine
create Machine "shaiksameer.com" as Machinename;
//Create JDBC datasource and targeting it to cluster
//create JDBCConnectionPool "demoPool" as mypool;
//set mypool.DriverName "com.pointbase.jdbc.jdbcUniversalDriver";
//set mypool.URL "jdbc:pointbase:server://localhost:9092/demo";
//set mypool.Password "PBPUBLIC";
//set mypool.Properties "user=PBPUBLIC";
//assign JDBCConnectionPool "*" to target "MyCluster";
//Create File Store
//create JMSFileStore "FileStore" as filestore;
//set filestore.Directory "d:\FStore";
//create JMS server
//create JMSServer "JMSServer" as jmsserver;
//set jmsserver.PersistentStore "FileStore"; //Add persistence store to the JMS server
//assign JMSServer "*" to target "MS1″;
//create JMS queue, default subdeployment will be created and targeted. Not sure
//create JMSQueue "Queue" as queue;
//set queue.JNDIName "jms/queue"; //JNDI name for Queue
//set queue.JMSServer "JMSServer"; //Target queue to JMS server
//use templates default weblogic user
find User "weblogic" as u1;
set u1.password "12345678";
//create a new user
create User "shaiksameer" as u2;
set u2.password "weblogic4u";
write domain to "/u01/app/oracle/middleware/user_projects/domains/demo_domain"; // The domain name will be "demo-domain"
close template;
运行config文件,并选择mode方式为silent,silent_script指向刚才的创建的rsp文件。
[root@localhost ~]# cd /u01/app/oracle/middleware/wlserver_10.3/common/bin/
[root@localhost ~]# ./config -mode=silent -silent_script=domain_silent.rsp
part 8 浏览器访问
启动服务,并检查
[root@localhost ~]# cd /u01/app/oracle/middleware/user_projects/domains/demo_domain/bin
[root@localhost ~]# ./startWebLogic.sh
然后在浏览器中访问http://[IP]:port/console,输入账号密码,登陆即可。
如果发生不能访问的问题。可以关闭firewalld服务再次登陆。
网友评论