Skip to content

Commit 8bb16a7

Browse files
Hemastutibrunoborges
authored andcommitted
Readme Enhancements and Default script Change (#183)
* Enhancement : OHS Docker Solution with Docker Data Volume Now user can provide custom Oracle Weblogic Proxy Plugin file containing directives as per their weblogic environments . This file will need to be placed in docker data volume , which in turn will be mounted during OHS container creation. In this way, the same OHS docker solution can be used to route applications running on either Weblogic Admin Server or Weblogic cluster or set of individual Managed Servers . * Changing the default script and README formatting * readme enhancement #1 * README enhancement and script message enhancement * Readme enhancement #2
1 parent 3bed6a9 commit 8bb16a7

File tree

6 files changed

+83
-82
lines changed

6 files changed

+83
-82
lines changed

OracleHTTPServer/README.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -60,41 +60,40 @@ Verify you now have this image in place with
6060
$ docker images
6161

6262
### How to run container
63-
1. As prerequisite run the below command to create a docker data volume.
6463

65-
Eg:$ docker volume create --name volume
64+
**Prerequisite** : Create a docker data volume which will contain the Oracle Weblogic Proxy Plugin file
65+
66+
Eg:$ docker volume create --name volume
6667

6768
_This volume will be created in "/var/lib/docker" directory or the location where "/var/lib/docker" points to._
6869

6970

70-
2. Depending on your weblogic environment , create a **custom_mod_wl_ohs.conf** file by referring to container-scripts/mod_wl_ohs.conf.sample and section 2.4 @ [OHS 12c Documentation](http://docs.oracle.com/middleware/1221/webtier/develop-plugin/oracle.htm#PLGWL553)
71+
1. Depending on your weblogic environment , create a **custom_mod_wl_ohs.conf** file by referring to container-scripts/mod_wl_ohs.conf.sample and section 2.4 @ [OHS 12c Documentation](http://docs.oracle.com/middleware/1221/webtier/develop-plugin/oracle.htm#PLGWL553)
7172

72-
3. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
73+
2. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
7374

74-
4. To start the OHS Container with above sampleohs:12.2.1 image , run command from docker voume directory
75+
3. To start the OHS Container with above sampleohs:12.2.1 image , run command from docker voume directory
7576

76-
For e.g.
77-
$ cd /var/lib/docker/volume
78-
$ docker run -v `pwd`:/volume -w /volume -d --name ohs -p 7777:7777 sampleohs:12.2.1 configureWLSProxyPlugin.sh
77+
For e.g
78+
$ cd /var/lib/docker/volume
79+
$ docker run -v `pwd`:/volume -w /volume -d --name ohs -p 7777:7777 sampleohs:12.2.1 configureWLSProxyPlugin.sh
7980

8081

8182
The **configureWLSProxyPlugin.sh** script will be the first script to be run inside the OHS container .
8283
This script will perform the following actions:
83-
- Start the Node Manager and OHS server
8484
- Fetch the custom_mod_wl_ohs.conf file from mounted shared data volume
8585
- Place the custom_mod_wl_ohs.conf file under OHS INSTANCE home
86-
- Restart OHS server
87-
88-
_NOTE: If custom_mod_wl_ohs.conf is not provided or not found under mounted shared data volume, then configureWLSProxyPlugin.sh will still start OHS server which will be accessible @ http://localhost:7777/index.html._
89-
90-
_Later you can login to running container and configure Weblogic Server proxy plugin file and run restartOHS script._
86+
- Start Node manager and OHS server
9187

92-
93-
5. Sanity URLs check for OHS server
88+
4. Sanity URLs check for OHS server
9489
- Now you can access the OHS index page @ http://localhost:7777/index.html
9590
- Static html page @ URL http://localhost:7777/helloWorld.html
9691

97-
6. All applications should now be routed via the OHS port 7777.
92+
5. All applications should now be routed via the OHS port 7777.
93+
94+
######NOTE: If custom_mod_wl_ohs.conf is not provided or not found under mounted shared data volume, then configureWLSProxyPlugin.sh will still start OHS server which will be accessible @ http://localhost:7777/index.html.
95+
96+
######Later you can login to running container and configure Weblogic Server proxy plugin file and run *restartOHS.sh* script.
9897

9998

10099
## Support

OracleHTTPServer/samples/1221-ohs-domain/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ USER oracle
6060
WORKDIR /u01/oracle/container-scripts
6161

6262
# Define default command to start bash
63-
CMD ["bash"]
63+
CMD ["startNMandOHS.sh"]

OracleHTTPServer/samples/1221-ohs-domain/README.md

+44-36
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,33 @@ This Dockerfile extends the Oracle HTTP Install image by creating a sample OHSdo
44
During OHS container creation Oracle WebLogic Server Proxy Plug-In can be configured in order to load balance applications deployed onto either the Weblogic Admin Server, the Managed Servers or the WebLogic cluster running on docker containers within the same network.
55

66
## How to build image and run container
7-
First make sure you have the Oracle HTTP install image (oracle/ohs:12.2.1-sa) ready by running following command as root user
8-
$ docker images
7+
1.First make sure you have the Oracle HTTP install image (oracle/ohs:12.2.1-sa) ready by running following command as root user
98

10-
1.To build the OHS domain image using this sample Dockerfile, run command:
9+
$ docker images
1110

12-
$ docker build --force-rm=true --no-cache=true --rm=true -t sampleohs:12.2.1 --build-arg NM_PASSWORD=welcome1 .
11+
2.To build the OHS domain image using this sample Dockerfile, run command:
1312

14-
2. Run the below command to create a docker data volume.
13+
$ docker build --force-rm=true --no-cache=true --rm=true -t sampleohs:12.2.1 --build-arg NM_PASSWORD=welcome1 .
1514

16-
Eg:$ docker volume create --name volume
15+
3.Run the below command to create a docker data volume.
16+
17+
Eg:$ docker volume create --name volume
1718

18-
_This data volume will be created in "/var/lib/docker" directory or the location where "/var/lib/docker" points to._
19+
_This data volume will be created in "/var/lib/docker" directory or the location where "/var/lib/docker" points to._
1920

20-
3. Depending on your Weblogic environment , create a **custom_mod_wl_ohs.conf** file by referring to container-scripts/mod_wl_ohs.conf.sample and section 2.4 @ [OHS 12c Documentation](http://docs.oracle.com/middleware/1221/webtier/develop-plugin/oracle.htm#PLGWL553)
21+
4.Depending on your Weblogic environment , create a **custom_mod_wl_ohs.conf** file by referring to container-scripts/mod_wl_ohs.conf.sample and section 2.4 @ [OHS 12c Documentation](http://docs.oracle.com/middleware/1221/webtier/develop-plugin/oracle.htm#PLGWL553)
2122

22-
4. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
23+
5.Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
2324

24-
4. To start the OHS Container with above sampleohs:12.2.1 image , run command from data volume directory:
25+
6.To start the OHS Container with above sampleohs:12.2.1 image , run command from data volume directory:
2526

2627
$ cd /var/lib/docker/volume
2728
$ docker run -v `pwd`:/volume -w /volume -d --name ohs -p 7777:7777 sampleohs:12.2.1 configureWLSProxyPlugin.sh
2829

29-
5. All applications will now be accessible via the OHS port 7777.
30+
7.All applications will now be accessible via the OHS port 7777.
3031

31-
######NOTE: If custom_mod_wl_ohs.conf is not provided, then configureWLSProxyPlugin.sh will just start OHS which will be accessible @ http://localhost:7777/index.html. Later you can login to running container and configure Weblogic Server proxy plugin file and run restartOHS script.
32+
######NOTE: If custom_mod_wl_ohs.conf is not provided, then configureWLSProxyPlugin.sh will just start OHS which will be accessible @ http://localhost:7777/index.html.
33+
######Later you can login to running container and configure Weblogic Server proxy plugin file and run restartOHS script.
3234

3335

3436
## Configuring the Oracle WebLogic Server Proxy Plug-In with Oracle HTTP Server
@@ -56,29 +58,36 @@ Depending on the nature of your applications create your own "custom_mod_wl_ohs.
5658

5759
##### To configure Oracle WebLogic Server Proxy Plug-In inside OHS container
5860

59-
1. Create the custom_mod_wl_ohs.conf file by referring to container-scripts/mod_wl_ohs.conf.sample
61+
**Prerequisite** : Create a docker data volume which will contain the Oracle weblogic Porxy Plugin file
6062

61-
For e.g
62-
LoadModule weblogic_module "/u01/oracle/ohssa/ohs/modules/mod_wl_ohs.so"
63-
<IfModule mod_weblogic.c>
64-
WebLogicHost myhost
65-
WebLogicPort 7001
66-
</IfModule>
67-
#
68-
# Directive for weblogic admin console deployed on Admin Server
69-
<Location /console>
70-
WLSRequest On
71-
WebLogicHost myhost
72-
WeblogicPort 7001
73-
</Location>
74-
#
75-
# Directive for all application deployed on weblogic cluster with prepath /weblogic
76-
<Location /weblogic>
77-
WLSRequest On
78-
WebLogicCluster myhost:9001,myhost:9002
79-
PathTrim /weblogic
80-
</Location>
63+
Eg:$ docker volume create --name volume
64+
65+
_This volume will be created in "/var/lib/docker" directory or the location where "/var/lib/docker" points to._
66+
67+
1. Create the custom_mod_wl_ohs.conf file by referring to container-scripts/mod_wl_ohs.conf.sample
8168

69+
```
70+
For e.g
71+
LoadModule weblogic_module "$OHS_ORACLE_HOME/ohs/modules/mod_wl_ohs.so"
72+
<IfModule mod_weblogic.c>
73+
WebLogicHost myhost
74+
WebLogicPort 7001
75+
</IfModule>
76+
#
77+
# Directive for weblogic admin console deployed on Admin Server
78+
<Location /console>
79+
WLSRequest On
80+
WebLogicHost myhost
81+
WeblogicPort 7001
82+
</Location>
83+
#
84+
# Directive for all application deployed on weblogic cluster with prepath /weblogic
85+
<Location /weblogic>
86+
WLSRequest On
87+
WebLogicCluster myhost:9001,myhost:9002
88+
PathTrim /weblogic
89+
</Location>
90+
```
8291

8392
2. Place it in docker data volume directory say /var/lib/docker/volume
8493

@@ -90,17 +99,16 @@ Depending on the nature of your applications create your own "custom_mod_wl_ohs.
9099

91100
The **configureWLSProxyPlugin.sh** script will be the first script to be run inside the OHS container .
92101
This script will perform the following actions:
93-
- Start the Node Manager and OHS server
94102
- Fetch the custom_mod_wl_ohs.conf file from mounted shared data volume
95103
- Place the custom_mod_wl_ohs.conf file under OHS INSTANCE home
96-
- Restart OHS server
104+
- Start Node Manager and OHS server
97105

98106
4. Now you will be able to access all the URLS via the OHS Listen Port 7777
99107
- http://localhost:7777/console
100108
- http://localhost:7777/weblogic/sample
101109

102110
_NOTE: If custom_mod_wl_ohs.conf is not provided or not found under mounted shared data volume, then configureWLSProxyPlugin.sh will still start OHS server which will be accessible @ http://localhost:7777/index.html._
103-
_Later you can login to running container and configure Weblogic Server proxy plugin file and run restartOHS script._
111+
_Later you can login to running container and configure Weblogic Server proxy plugin file and run **restartOHS.sh** script._
104112

105113

106114
# Copyright

OracleHTTPServer/samples/1221-ohs-domain/container-scripts/configureWLSProxyPlugin-WLSMultihost.sh

+6-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#MW_HOME - The root directory of your OHS standalone install
1616
#DOMAIN_NAME - Env Value set by Dockerfile , default is "ohsDOmain"
1717
#OHS_COMPONENT_NAME - Env Value set by Dockerfile , default is "ohs_sa1"
18-
#WEBLOGIC_HOST, WEBLOGIC_PORT, WEBLOGIC_CLUSTER - Env values passed from env.list
18+
#WEBLOGIC_HOST, WEBLOGIC_PORT, WEBLOGIC_CLUSTER - Env values passed from command line
1919
#*************************************************************************
2020
echo "MW_HOME=${MW_HOME:?"Please set MW_HOME"}"
2121
echo "DOMAIN_NAME=${DOMAIN_NAME:?"Please set DOMAIN_NAME"}"
@@ -29,11 +29,6 @@ INSTANCE_CONFIG_HOME=$DOMAIN_HOME/config/fmwconfig/components/OHS/${OHS_COMPONEN
2929
export INSTANCE_CONFIG_HOME
3030
echo "INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}"
3131

32-
#Start NodeManager and OHS server
33-
echo "Starting Node Manager and OHS server"
34-
/u01/oracle/container-scripts/startNMandOHS.sh
35-
36-
3732
#Modify the variables in the mod_wl_ohs.conf.sample file with values provided in the env.file
3833
cp /u01/oracle/container-scripts/mod_wl_ohs.conf.sample /u01/oracle/container-scripts/mod_wl_ohs.conf.sample.WLSMultiHost
3934
sed -i -e "s/WEBLOGIC_HOST/$WEBLOGIC_HOST/g" -e "s/WEBLOGIC_PORT/$WEBLOGIC_PORT/g" -e "s/WEBLOGIC_CLUSTER/$WEBLOGIC_CLUSTER/g" mod_wl_ohs.conf.sample.WLSMultiHost
@@ -45,9 +40,9 @@ mv mod_wl_ohs.conf mod_wl_ohs.conf.ORIGINAL
4540
echo "Copying plugin file to INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}"
4641
cp /u01/oracle/container-scripts/mod_wl_ohs.conf.sample.WLSMultiHost ${INSTANCE_CONFIG_HOME}/mod_wl_ohs.conf
4742

48-
# Restart ohs server
49-
echo "Restarting OHS server "
50-
/u01/oracle/container-scripts/restartOHS.sh
43+
#Start NodeManager and OHS server
44+
echo "Starting Node Manager and OHS server"
45+
/u01/oracle/container-scripts/startNMandOHS.sh
5146

52-
#Tail all server logs
53-
tail -f ${DOMAIN_HOME}/nodemanager/nodemanager.log ${DOMAIN_HOME}/servers/*/logs/*.out
47+
#Echo URL to be used for accessing applications deployed on weblogic clister
48+
echo "You may now access all the application deployed on weblogic cluster @ http://localhost:7777/weblogic/application_end_url"

OracleHTTPServer/samples/1221-ohs-domain/container-scripts/configureWLSProxyPlugin.sh

+11-16
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#MW_HOME - The root directory of your OHS standalone install
2323
#DOMAIN_NAME - Env Value set by Dockerfile , default is "ohsDOmain"
2424
#OHS_COMPONENT_NAME - Env Value set by Dockerfile , default is "ohs_sa1"
25-
#WEBLOGIC_HOST, WEBLOGIC_PORT, WEBLOGIC_CLUSTER - Env values passed from env.list
2625
#*************************************************************************
2726
echo "MW_HOME=${MW_HOME:?"Please set MW_HOME"}"
2827
echo "DOMAIN_NAME=${DOMAIN_NAME:?"Please set DOMAIN_NAME"}"
@@ -33,11 +32,6 @@ INSTANCE_CONFIG_HOME=$DOMAIN_HOME/config/fmwconfig/components/OHS/${OHS_COMPONEN
3332
export INSTANCE_CONFIG_HOME
3433
echo "INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}"
3534

36-
#Start NodeManager and OHS server
37-
echo "Starting Node Manager and OHS server"
38-
/u01/oracle/container-scripts/startNMandOHS.sh
39-
40-
4135
#Search for the customized mod_wl_ohs.conf file
4236
modwlsconfigfile=`find / -name 'custom_mod_wl_ohs.conf' 2>&1 | grep -v 'Permission denied'`
4337
export modwlsconfigfile
@@ -46,15 +40,16 @@ export modwlsconfigfile
4640
if [[ -n "${modwlsconfigfile/[ ]*\n/}" ]]; then
4741
cd ${INSTANCE_CONFIG_HOME}
4842
mv mod_wl_ohs.conf mod_wl_ohs.conf.ORIGINAL
49-
echo "Copying ${modwlsconfigfile} to ${INSTANCE_CONFIG_HOME} and restarting OHS server"
43+
echo "Copying ${modwlsconfigfile} to ${INSTANCE_CONFIG_HOME} "
5044
cp ${modwlsconfigfile} ${INSTANCE_CONFIG_HOME}/mod_wl_ohs.conf
51-
echo "Restarting OHS server after successful configuration of WebLogic Server Proxy Plug-In "
52-
/u01/oracle/container-scripts/restartOHS.sh
53-
echo "You may now access the the application deployed to the DockerCluster @ http://myhost:7777/weblogic/application_end_url"
45+
echo "Starting Node Manager and OHS server after successful configuration of WebLogic Server Proxy Plug-In "
46+
/u01/oracle/container-scripts/startNMandOHS.sh
47+
echo "You may now access the the application via OHS port 7777 @ http://localhost:7777/application_end_url"
48+
#
49+
# Incase custom_mod_wl_ohs.conf file is not provided/found, OHS will be started with default settings
5450
else
55-
echo "Customized mod_wl_ohs.conf file not found in mounted volume!!! WebLogic Server Proxy Plug-In has not been configured, but OHS is running "
56-
echo "You may now access OHS @ http://myhost:7777/index.html"
57-
fi
58-
59-
#Tail all server logs
60-
tail -f ${DOMAIN_HOME}/nodemanager/nodemanager.log ${DOMAIN_HOME}/servers/*/logs/*.out
51+
echo "Customized mod_wl_ohs.conf file not found in mounted volume!!! WebLogic Server Proxy Plug-In has not been configured."
52+
echo "Starting Node Manager and OHS server with default settings "
53+
/u01/oracle/container-scripts/startNMandOHS.sh
54+
echo "You may now access OHS @ http://localhost:7777/index.html"
55+
fi

OracleHTTPServer/samples/1221-ohs-domain/container-scripts/startNMandOHS.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,8 @@ if [ -f /u01/oracle/logs/Nodemanage$$.status ]; then
7474
echo "Node manager running, hence starting OHS server"
7575
${WLST_HOME}/wlst.sh /u01/oracle/container-scripts/start-ohs.py
7676
echo "OHS server has been started "
77-
fi
77+
fi
78+
79+
80+
#Tail all server logs
81+
tail -f ${DOMAIN_HOME}/nodemanager/nodemanager.log ${DOMAIN_HOME}/servers/*/logs/*.out

0 commit comments

Comments
 (0)