Spread the love


Automation always saves your considerable time. Especially when you have to follow the similar step for hundreds of machine, automated scripts and tools have always been a great weapon for system administrators.Today I spent considerable time to setup Weblogic Server 10.3.6 on my CentOS 7.0 machine through shell script. This unattended script uses autoexpect rather than silent.xml or WLST as suggested by Oracle. Let me share the steps I followed to deploy the Weblogic Server:

Ensure you have the following software in place downloaded from Oracle Website.We can’t use wget for this as it requires Oracle Login for downloading these pieces of software.

Links for Software Downloads:

a. Download jdk-7u67-linux-i586.gz from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
b. Download wls1036_dev.zip from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html

Once you download the above software, create a directory called /softwaretmp/ and download the above software into this directory:

#mkdir /softwaretmp/

#cd /softwaretmp/


2. Create an empty file called prepare.sh and paste the following shell script (shown below):

echo “Checking if WebLogic Server is already runing. If its running, stopping it and reinstalling it from scratch”
pkill -9 java
pkill -9 Weblogic
rm -fr /u01/oracle/wlsdomains/base_domain
rm -fr /u01/oracle/fmw/wlserver_10.3
rm -fr /u01/jdk/jdk7
pkill -9 java
echo “Initializing the Installation”
groupadd orainstall
useradd -g orainstall oracle
mkdir -p /u01/jdk
cd /u01/jdk
tar -zxvf /softwaretmp/jdk-7u67-linux-i586.gz
ln -s jdk1.7.0_67 jdk7
mkdir -p /u01/oracle/fmw/wlserver_10.3
cp -rf /softwaretmp/wls1036_dev.zip /u01/oracle/fmw/wlserver_10.3/
echo ”
MW_HOME=/u01/oracle/fmw/wlserver_10.3; export MW_HOME
JAVA_HOME=/u01/jdk/jdk7; export JAVA_HOME
” >> ~/.bash_profile
cd ~
. ./.bash_profile
cd /u01/oracle/fmw/wlserver_10.3
unzip wls1036_dev.zip
. $MW_HOME/wlserver/server/bin/setWLSEnv.sh
mkdir -p /u01/oracle/wlsdomains
cp -rf /softwaretmp/script.exp /u01/oracle/fmw/wlserver_10.3/wlserver/common/bin/
cd /u01/oracle/fmw/wlserver_10.3/wlserver/common/bin
echo ” Expect Script is well run”
cd /u01/oracle/wlsdomains/base_domain/
mkdir -p servers/AdminServer/security
mkdir -p servers/managedserver_1/security
cd servers/AdminServer/security
” >> boot.properties
cd /u01/oracle/wlsdomains/base_domain/servers/managedserver_1/security
” >> boot.properties
echo ” Weblogic Server 10.3.6 Configuration is all done !!”
echo “Starting the Weblogic Server”
cd /softwaretmp/

3. You need to add two more scripts to the /softwaretmp directory:

Create a empty file called startweblogic.sh and paste the below content:

#!/usr/bin/expect -f
cd /u01/oracle/wlsdomains/base_domain/bin/
spawn ./startWebLogic.sh
expect “Enter username to boot WebLogic server: ”
send “weblogic\r”
expect “$ ”
expect “Enter password to boot WebLogic server: ”
send “Oracle9ias\r”
expect “$ ”
send “exit\r”

Also, create another empty file called startManagedServer.sh and paste the below lines:

#!/usr/bin/expect -f
cd /u01/oracle/wlsdomains/base_domain/bin/
spawn ./startManagedWebLogic.sh managedserver_1
expect “Enter username to boot WebLogic server: ”
send “weblogic\r”
expect “$ ”
expect “Enter password to boot WebLogic server: ”
send “Oracle9ias\r”
expect “$ ”
send “exit\r”

Save the file.

4. Now comes the important step. You need to create script.exp file through series of steps. You can always create script.exp through the following steps:

a. Ensure that the autoexpect software through the following command:

#yum install autoexpect

b. Start the autoexpect tool through the following command:

#autoexpect -s

It will output that autoexpect has already initiated and will be saved under script.exp

c. Now run the following command under /u01/oracle/fmw/wlserver_10.3/wlserver/common/bin

#cd /u01/oracle/fmw/wlserver_10.3/wlserver/common/bin


Follow the general steps for selecting the right options as per your infrastructure.

Once completed, ensure you run the following command:


autoexpect stopped.

Once you have completed the above steps, a script.exp gets created which has to be copied to /softwaretmp directory.

Still finding difficulty? Post your questions at https://collabnix.com/forum


Spread the love
Categories: Docker

Ajeet Raina

My name is Ajeet Singh Raina and I am an author of this blogging site. I am a Docker Captain, ARM Innovator & Docker Bangalore Community Leader. I bagged 2 special awards last year(2019): Firstly, “The Tip of Captain’s Hat Award” at Dockercon 2019, San Francisco, and secondly, “2019 Docker Community Award“. I run Collabnix Community Slack with over 5300+ audience . I have built popular GITHUB repositories like DockerLabs, KubeLabs, Kubetools, RedisPlanet Terraform etc. with the support of Collabnix Community. Currently working as Developer Relations Manager at Redis Labs where I help customers and community members adopt Redis. With over 12,000+ followers over LinkedIn & close to 5100+ twitter followers, I like sharing Docker and Kubernetes related content . You can follow me on Twitter(@ajeetsraina) & GitHub(@ajeetraina)


rajiv · 21st June 2016 at 1:58 pm

Hi ,

Nice article. Really helps but where is script.exp and what does it contain?

Charleen Lie · 31st August 2016 at 2:18 pm

Someone essentially help to make seriously posts I would state. This is the first time I frequented your website page and thus far? I amazed with the research you made to make this particular publish incredible. Great job!

http://kominkikwidzinski.pl · 10th October 2016 at 11:42 pm

Just want to say your article is as astonishing. The clearness in your publish is simply nice and i could think you are a professional in this subject. Fine together with your permission allow me to grab your RSS feed to stay up to date with coming near near post. Thanks a million and please continue the enjoyable work.

Tara Gupta · 11th October 2016 at 7:53 am

You need to take part in a contest for among the finest blogs on the web. I’ll suggest this web site!

KOMINKI GDANSK · 11th October 2016 at 9:52 am

Very nice post. I simply stumbled upon your weblog and wished to mention that I have really enjoyed surfing around your blog posts. In any case I will be subscribing on your feed and I’m hoping you write once more soon!

Alva Lenhardt · 16th October 2016 at 9:35 pm

What’s up, every time i used to check webpage posts here in the early hours in the daylight, as i like to learn more and more.|

Melanie S. · 13th November 2016 at 11:01 am

Good writing skills here, I like it 🙂

TienSNiehaus · 24th November 2016 at 7:36 am

I am sure this piece of writing has touched all the internet users, its really
really nice component of writing on strengthening new website.

Armand Steuart · 5th January 2017 at 4:22 pm

Really good site, thanks you so much for your effort in written the post

Leave a Reply

Your email address will not be published. Required fields are marked *

Join Collabnix SlackIt's 100% FREE!

Get chance to chat with 5500+ DevOps Engineers !