Skip to content

Readme Enhancements and Default script Change #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions OracleHTTPServer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,40 @@ Verify you now have this image in place with
$ docker images

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

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

Eg:$ docker volume create --name volume

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


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)
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)

3. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
2. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume

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

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


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

_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._

_Later you can login to running container and configure Weblogic Server proxy plugin file and run restartOHS script._
- Start Node manager and OHS server


5. Sanity URLs check for OHS server
4. Sanity URLs check for OHS server
- Now you can access the OHS index page @ http://localhost:7777/index.html
- Static html page @ URL http://localhost:7777/helloWorld.html

6. All applications should now be routed via the OHS port 7777.
5. All applications should now be routed via the OHS port 7777.

######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.

######Later you can login to running container and configure Weblogic Server proxy plugin file and run *restartOHS.sh* script.


## Support
Expand Down
2 changes: 1 addition & 1 deletion OracleHTTPServer/samples/1221-ohs-domain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ USER oracle
WORKDIR /u01/oracle/container-scripts

# Define default command to start bash
CMD ["bash"]
CMD ["startNMandOHS.sh"]
80 changes: 44 additions & 36 deletions OracleHTTPServer/samples/1221-ohs-domain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@ This Dockerfile extends the Oracle HTTP Install image by creating a sample OHSdo
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.

## How to build image and run container
First make sure you have the Oracle HTTP install image (oracle/ohs:12.2.1-sa) ready by running following command as root user
$ docker images
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

1.To build the OHS domain image using this sample Dockerfile, run command:
$ docker images

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

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

Eg:$ docker volume create --name volume
3.Run the below command to create a docker data volume.

Eg:$ docker volume create --name volume

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

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)
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)

4. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
5.Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume

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

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

5. All applications will now be accessible via the OHS port 7777.
7.All applications will now be accessible via the OHS port 7777.

######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.
######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.


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

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

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

For e.g
LoadModule weblogic_module "/u01/oracle/ohssa/ohs/modules/mod_wl_ohs.so"
<IfModule mod_weblogic.c>
WebLogicHost myhost
WebLogicPort 7001
</IfModule>
#
# Directive for weblogic admin console deployed on Admin Server
<Location /console>
WLSRequest On
WebLogicHost myhost
WeblogicPort 7001
</Location>
#
# Directive for all application deployed on weblogic cluster with prepath /weblogic
<Location /weblogic>
WLSRequest On
WebLogicCluster myhost:9001,myhost:9002
PathTrim /weblogic
</Location>
Eg:$ docker volume create --name volume

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

1. Create the custom_mod_wl_ohs.conf file by referring to container-scripts/mod_wl_ohs.conf.sample

```
For e.g
LoadModule weblogic_module "$OHS_ORACLE_HOME/ohs/modules/mod_wl_ohs.so"
<IfModule mod_weblogic.c>
WebLogicHost myhost
WebLogicPort 7001
</IfModule>
#
# Directive for weblogic admin console deployed on Admin Server
<Location /console>
WLSRequest On
WebLogicHost myhost
WeblogicPort 7001
</Location>
#
# Directive for all application deployed on weblogic cluster with prepath /weblogic
<Location /weblogic>
WLSRequest On
WebLogicCluster myhost:9001,myhost:9002
PathTrim /weblogic
</Location>
```

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

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

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

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

_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._
_Later you can login to running container and configure Weblogic Server proxy plugin file and run restartOHS script._
_Later you can login to running container and configure Weblogic Server proxy plugin file and run **restartOHS.sh** script._


# Copyright
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#MW_HOME - The root directory of your OHS standalone install
#DOMAIN_NAME - Env Value set by Dockerfile , default is "ohsDOmain"
#OHS_COMPONENT_NAME - Env Value set by Dockerfile , default is "ohs_sa1"
#WEBLOGIC_HOST, WEBLOGIC_PORT, WEBLOGIC_CLUSTER - Env values passed from env.list
#WEBLOGIC_HOST, WEBLOGIC_PORT, WEBLOGIC_CLUSTER - Env values passed from command line
#*************************************************************************
echo "MW_HOME=${MW_HOME:?"Please set MW_HOME"}"
echo "DOMAIN_NAME=${DOMAIN_NAME:?"Please set DOMAIN_NAME"}"
Expand All @@ -29,11 +29,6 @@ INSTANCE_CONFIG_HOME=$DOMAIN_HOME/config/fmwconfig/components/OHS/${OHS_COMPONEN
export INSTANCE_CONFIG_HOME
echo "INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}"

#Start NodeManager and OHS server
echo "Starting Node Manager and OHS server"
/u01/oracle/container-scripts/startNMandOHS.sh


#Modify the variables in the mod_wl_ohs.conf.sample file with values provided in the env.file
cp /u01/oracle/container-scripts/mod_wl_ohs.conf.sample /u01/oracle/container-scripts/mod_wl_ohs.conf.sample.WLSMultiHost
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
Expand All @@ -45,9 +40,9 @@ mv mod_wl_ohs.conf mod_wl_ohs.conf.ORIGINAL
echo "Copying plugin file to INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}"
cp /u01/oracle/container-scripts/mod_wl_ohs.conf.sample.WLSMultiHost ${INSTANCE_CONFIG_HOME}/mod_wl_ohs.conf

# Restart ohs server
echo "Restarting OHS server "
/u01/oracle/container-scripts/restartOHS.sh
#Start NodeManager and OHS server
echo "Starting Node Manager and OHS server"
/u01/oracle/container-scripts/startNMandOHS.sh

#Tail all server logs
tail -f ${DOMAIN_HOME}/nodemanager/nodemanager.log ${DOMAIN_HOME}/servers/*/logs/*.out
#Echo URL to be used for accessing applications deployed on weblogic clister
echo "You may now access all the application deployed on weblogic cluster @ http://localhost:7777/weblogic/application_end_url"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#MW_HOME - The root directory of your OHS standalone install
#DOMAIN_NAME - Env Value set by Dockerfile , default is "ohsDOmain"
#OHS_COMPONENT_NAME - Env Value set by Dockerfile , default is "ohs_sa1"
#WEBLOGIC_HOST, WEBLOGIC_PORT, WEBLOGIC_CLUSTER - Env values passed from env.list
#*************************************************************************
echo "MW_HOME=${MW_HOME:?"Please set MW_HOME"}"
echo "DOMAIN_NAME=${DOMAIN_NAME:?"Please set DOMAIN_NAME"}"
Expand All @@ -33,11 +32,6 @@ INSTANCE_CONFIG_HOME=$DOMAIN_HOME/config/fmwconfig/components/OHS/${OHS_COMPONEN
export INSTANCE_CONFIG_HOME
echo "INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}"

#Start NodeManager and OHS server
echo "Starting Node Manager and OHS server"
/u01/oracle/container-scripts/startNMandOHS.sh


#Search for the customized mod_wl_ohs.conf file
modwlsconfigfile=`find / -name 'custom_mod_wl_ohs.conf' 2>&1 | grep -v 'Permission denied'`
export modwlsconfigfile
Expand All @@ -46,15 +40,16 @@ export modwlsconfigfile
if [[ -n "${modwlsconfigfile/[ ]*\n/}" ]]; then
cd ${INSTANCE_CONFIG_HOME}
mv mod_wl_ohs.conf mod_wl_ohs.conf.ORIGINAL
echo "Copying ${modwlsconfigfile} to ${INSTANCE_CONFIG_HOME} and restarting OHS server"
echo "Copying ${modwlsconfigfile} to ${INSTANCE_CONFIG_HOME} "
cp ${modwlsconfigfile} ${INSTANCE_CONFIG_HOME}/mod_wl_ohs.conf
echo "Restarting OHS server after successful configuration of WebLogic Server Proxy Plug-In "
/u01/oracle/container-scripts/restartOHS.sh
echo "You may now access the the application deployed to the DockerCluster @ http://myhost:7777/weblogic/application_end_url"
echo "Starting Node Manager and OHS server after successful configuration of WebLogic Server Proxy Plug-In "
/u01/oracle/container-scripts/startNMandOHS.sh
echo "You may now access the the application via OHS port 7777 @ http://localhost:7777/application_end_url"
#
# Incase custom_mod_wl_ohs.conf file is not provided/found, OHS will be started with default settings
else
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 "
echo "You may now access OHS @ http://myhost:7777/index.html"
fi

#Tail all server logs
tail -f ${DOMAIN_HOME}/nodemanager/nodemanager.log ${DOMAIN_HOME}/servers/*/logs/*.out
echo "Customized mod_wl_ohs.conf file not found in mounted volume!!! WebLogic Server Proxy Plug-In has not been configured."
echo "Starting Node Manager and OHS server with default settings "
/u01/oracle/container-scripts/startNMandOHS.sh
echo "You may now access OHS @ http://localhost:7777/index.html"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@ if [ -f /u01/oracle/logs/Nodemanage$$.status ]; then
echo "Node manager running, hence starting OHS server"
${WLST_HOME}/wlst.sh /u01/oracle/container-scripts/start-ohs.py
echo "OHS server has been started "
fi
fi


#Tail all server logs
tail -f ${DOMAIN_HOME}/nodemanager/nodemanager.log ${DOMAIN_HOME}/servers/*/logs/*.out