You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhancement : OHS Docker Solution with Docker Data Volume (#175)
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 .
Copy file name to clipboardExpand all lines: OracleHTTPServer/README.md
+31-19
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,15 @@ Before you can build these WebLogic images, you must download the Oracle Server
13
13
## How to Build and Run
14
14
This project offers sample Dockerfiles for Oracle HTTP Server 12cR2 (12.2.1) in standalone mode. To assist in building the images, you can use the buildDockerImage.sh script. See below for instructions and usage
15
15
16
-
The **buildDockerImage.sh** script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call docker build with their prefered set of parameters.
16
+
The **buildDockerImage.sh** script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call docker build with their preferred set of parameters.
17
17
18
18
### Building OHS Docker Install Images
19
19
IMPORTANT: You have to download the binaries of OHS and Oracle JDK and put them in place (see .download files inside dockerfiles/).
20
20
21
21
Download the required packages (see .download files) and drop them in the folder of your distribution version of choice. Then go into the **dockerfiles** folder and run the **buildDockerImage.sh** script as root.
22
22
23
+
$ sh buildDockerImage.sh -v 12.2.1
24
+
23
25
IMPORTANT: the resulting images will NOT have a domain pre-configured.
24
26
You must extend the image with your own Dockerfile, and create your domain using WLST. You might take a look at the use case samples as well below.
25
27
@@ -42,11 +44,11 @@ The best way to create your own, or extend domains is by using WebLogic Scriptin
42
44
## Building a sample Docker Image of a OHS Domain
43
45
To try a sample of a OHS standalone image with a domain configured, follow the steps below:
44
46
45
-
Make sure you have oracle/ohs:12.2.1-sa image built. If not go into **dockerfiles/12.2.1** and call:
47
+
Make sure you have **oracle/ohs:12.2.1-sa** image built. If not go into **dockerfiles/12.2.1** and call:
46
48
47
49
$ sh buildDockerImage.sh -v 12.2.1
48
50
49
-
### How to Build Image
51
+
### How to Build OHS domain Image
50
52
Go to folder **samples/1221-OHS-domain**
51
53
52
54
Run the following command:
@@ -58,36 +60,46 @@ Verify you now have this image in place with
58
60
$ docker images
59
61
60
62
### How to run container
61
-
1. Edit the env.list file with relevant data from Weblogic container like Admin Server host, port, cluster info etc.
63
+
1. As prerequisite run the below command to create a docker data volume.
64
+
65
+
Eg:$ docker volume create --name volume
62
66
63
-
For example:
67
+
_This volume will be created in "/var/lib/docker" directory or the location where "/var/lib/docker" points to._
64
68
65
-
WEBLOGIC_HOST=myhost
66
-
WEBLOGIC_PORT=7001
67
-
WEBLOGIC_CLUSTER=myhost:9001,myhost:9002
68
69
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)
69
71
70
-
The values of WEBLOGIC_HOST, WEBLOGIC_PORT and WEBLOGIC_CLUSTER must be valid, existing containers running WebLogic servers.
72
+
3. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
71
73
72
-
2. Run this image by calling
74
+
4. To start the OHS Container with above sampleohs:12.2.1 image , run command from docker voume directory
73
75
74
-
$ docker run -d --env-file ./env.list -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 .
78
82
This script will perform the following actions:
79
-
- Starts the Node Manager and OHS server
80
-
- Edits the mod_wl_ohs.conf.sample with values passed via env.list
81
-
- Copies the mod_wl_ohs.conf file under INSTANCE home
82
-
- Restarts OHS server
83
+
- Start the Node Manager and OHS server
84
+
- Fetch the custom_mod_wl_ohs.conf file from mounted shared data volume
85
+
- 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._
83
91
84
-
3. Sanity URLs check for OHS server
92
+
93
+
5. Sanity URLs check for OHS server
85
94
- Now you can access the OHS index page @ http://localhost:7777/index.html
86
95
- Static html page @ URL http://localhost:7777/helloWorld.html
87
96
88
-
4. Weblogic Cluster : Now you will be able to access all URLS via the OHS Listen Port 7777
89
-
- Weblogic Console : http://myhost:7777/console
90
-
- Applications deployed on Weblogic Cluster : http://myhost:7777/$application_url_endpoint
97
+
6. All applications should now be routed via the OHS port 7777.
98
+
99
+
100
+
## Support
101
+
Currently Oracle HTTP Server on Docker is NOT supported by Oracle. Use these files at your own discretion.
102
+
91
103
92
104
## License
93
105
To download and run Oracle HTTP Server 12c Distribution regardless of inside or outside a Docker container, and regardless of the distribution, you must download the binaries from Oracle website and accept the license indicated at that page.
Example of Oracle HTTP Server with Weblogic Proxy Plugin
2
2
===============
3
-
This Dockerfile extends the Oracle HTTP Install image by creating a sample OHSdomain and configures Oracle WebLogic Server Proxy Plug-In in order to load balance a WebLogic cluster, from inside a container in the same network as the Weblogic Cluster.
3
+
This Dockerfile extends the Oracle HTTP Install image by creating a sample OHSdomain .
4
+
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.
4
5
5
6
## How to build image and run container
6
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
7
8
$ docker images
8
9
9
-
1.To build the domain image using this sample Dockerfile, run command:
10
+
1.To build the OHS domain image using this sample Dockerfile, run command:
2.To start the Container with above image , run command :
14
+
2. Run the below command to create a docker data volume.
14
15
15
-
$ docker run -d --env-file ./env.list -p 7777:7777 sampleohs:12.2.1 configureWLSProxyPlugin.sh
16
+
Eg:$ docker volume create --name volume
17
+
18
+
_This data volume will be created in "/var/lib/docker" directory or the location where "/var/lib/docker" points to._
19
+
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
+
22
+
4. Place the custom_mod_wl_ohs.conf file in docker data volume directory . e.g /var/lib/docker/volume
23
+
24
+
4. To start the OHS Container with above sampleohs:12.2.1 image , run command from data volume directory:
5. All applications will now be accessible via the OHS port 7777.
30
+
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.
16
32
17
-
######Note : env.list file should have valid values of WEBLOGIC_HOST, WEBLOGIC_PORT and WEBLOGIC_CLUSTER from existing containers running WebLogic servers.
18
33
19
34
## Configuring the Oracle WebLogic Server Proxy Plug-In with Oracle HTTP Server
35
+
20
36
Oracle WebLogic Server Proxy Plug-In (mod_wl_ohs)is used for proxying requests from Oracle HTTP Server to Oracle WebLogic Server.
21
-
The Oracle WebLogic Server Proxy Plug-In is included in the Oracle HTTP Server 12c (12.2.1) installation.
The Oracle WebLogic Server Proxy Plug-In is included in the Oracle HTTP Server 12c (12.2.1) installation by default.
38
+
39
+
A sample WebLogic Server Proxy Plug-In file has been provided @ **samples/1221-ohs-domain/container-scripts/mod_wl_ohs.conf.sample**
40
+
Refer [OHS 12c Documentation](http://docs.oracle.com/middleware/1221/webtier/develop-plugin/oracle.htm#PLGWL553) for more details and examples
41
+
42
+
Depending on the nature of your applications create your own "custom_mod_wl_ohs.conf" file.
23
43
24
-
To configure OHS server with WLS Proxy Plugin, a sample file mod_wl_ohs.conf.sample has been provided under **samples/1221-ohs-domain/container-scripts** folder.
25
-
The values for WEBLOGIC_HOST, WEBLOGIC_PORT and WEBLOGIC_CLUSTER will be used from values provided by user during docker run via the env.list
26
44
27
45
### Example with WLS Docker Container
28
46
@@ -32,32 +50,58 @@ The values for WEBLOGIC_HOST, WEBLOGIC_PORT and WEBLOGIC_CLUSTER will be used fr
32
50
-http://myhost:7001/console
33
51
34
52
2. Two WLS Containers with Managed Servers running on 9001 and 9002 ports (inside same weblogic cluster).
35
-
Assume some sample application is deployed on the each managed server and are accessible via URLs
36
-
-http://myhost:9001/sample1
37
-
-http://myhost:9002/sample2
53
+
Assume some "sample" application is deployed on the weblogic cluster and are accessible via URLs
54
+
-http://myhost:9001/sample
55
+
-http://myhost:9002/sample
38
56
39
57
##### To configure Oracle WebLogic Server Proxy Plug-In inside OHS container
40
58
41
-
1.Edit the env.list file and provide values
42
-
43
-
WEBLOGIC_HOST=myhost
44
-
WEBLOGIC_PORT=7001
45
-
WEBLOGIC_CLUSTER=myhost:9001,myhost:9002
46
-
47
-
2. As part of docker run command provide the env.file
48
-
49
-
$ docker run -d --env-file ./env.list -p 7777:7777 sampleohs:12.2.1 configureWLSProxyPlugin.sh
50
-
51
-
The **configureWLSProxyPlugin.sh** script will
59
+
1. Create the custom_mod_wl_ohs.conf file by referring to container-scripts/mod_wl_ohs.conf.sample
The **configureWLSProxyPlugin.sh** script will be the first script to be run inside the OHS container .
92
+
This script will perform the following actions:
52
93
- Start the Node Manager and OHS server
53
-
-Edit the mod_wl_ohs.conf.sample with right directives (based on values passed via env.list)
54
-
-Copy the mod_wl_ohs.conf file under INSTANCE home
94
+
-Fetch the custom_mod_wl_ohs.conf file from mounted shared data volume
95
+
-Place the custom_mod_wl_ohs.conf file under OHS INSTANCE home
55
96
- Restart OHS server
56
97
57
-
3. Now you will be able to access all the URLS via the OHS Listen Port 7777
58
-
-http://myhost:7777/console
59
-
-http://myhost:7777/sample1
60
-
-http://myhost:7777/sample2
98
+
4. Now you will be able to access all the URLS via the OHS Listen Port 7777
99
+
-http://localhost:7777/console
100
+
-http://localhost:7777/weblogic/sample
101
+
102
+
_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._
104
+
61
105
62
106
# Copyright
63
107
Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved.
0 commit comments