Skip to content
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

Adding OHS 12.2.1.4 dockerfiles and removing 12.2.1.3 which is no lon… #2796

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion OracleHTTPServer/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2001, 2019, Oracle Corporation. All rights reserved.
Copyright (c) 2020, 2024, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
38 changes: 19 additions & 19 deletions OracleHTTPServer/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Oracle HTTP Server on Docker
===============
Oracle HTTP Server in containers
===================================
This project includes quick start dockerfiles and samples for standalone Oracle HTTP Server based on Oracle Linux and Oracle JDK 8 (Server).
The certification of OHS on Docker does not require the use of any file presented in this repository.
The certification of OHS in containers does not require the use of any file presented in this repository.
Customers and users are welcome to use them as starters, and customize/tweak, or create from scratch new scripts and Dockerfiles.

## How to Build and Run
Expand All @@ -14,19 +14,19 @@ You must first download the Oracle Server JRE binary and drop in folder `../Orac

$ cd ../OracleJava/java-8
$ sh build.sh
You can also pull the Oracle Server JRE 8 image from [Oracle Container Registry](https://container-registry.oracle.com) or the [Docker Store](https://store.docker.com/images/oracle-serverjre-8).
You can also pull the Oracle Server JRE 8 image from [Oracle Container Registry](https://container-registry.oracle.com).

### Building OHS Docker Image
### Building OHS Container Image
IMPORTANT: You have to download the OHS binary and put it in place (see .download files inside dockerfiles/).

Download the required package (see .download file) and drop them in the version folder (12.2.1.3.0). Then go into the **dockerfiles** folder and run the **buildDockerImage.sh** script as root providing the version name with -v option.
Download the required package (see .download file) and drop them in the version folder (12.2.1.4.0). Then go into the **dockerfiles** folder and run the **buildDockerImage.sh** script as root providing the version name with -v option.

$ sh buildDockerImage.sh -v 12.2.1.3.0
$ sh buildDockerImage.sh -v 12.2.1.4.0

IMPORTANT: The resulting image will have a pre-configured domain.

### Providing the Node Manager password
The user name and password must be supplied in a domain.properties file located in a HOST directory that you will map at Docker runtime with the -v option to the image directory /u01/oracle/bootdir. The properties file enables the scripts to configure the correct authentication for the Node Manager.
The user name and password must be supplied in a domain.properties file located in a HOST directory that you will map at runtime with the -v option to the image directory /u01/oracle/bootdir. The properties file enables the scripts to configure the correct authentication for the Node Manager.

The format of the domain.properties file is key=value pair:
username=mynodemanagerusername
Expand All @@ -37,42 +37,42 @@ password=mynodemanagerpassword


If you want to start the OHS container without specifying any configuration for mod_weblogic:
1. To start the OHS container with oracle/ohs:12.2.1.3.0 image, run the following command:
1. To start the OHS container with oracle/ohs:12.2.1.4.0 image, run the following command:


docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -it --name ohs -p 7777:7777 oracle/ohs:12.2.1.3.0
docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -it --name ohs -p 7777:7777 oracle/ohs:12.2.1.4.0


If you want to start the OHS container with some pre-specified mod_weblogic configuration:
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/12213/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/12214/webtier/develop-plugin/oracle.htm#PLGWL553)

2. Place the custom_mod_wl_ohs.conf file in a directory in the host say,"/scratch/DockerVolume/OHSVolume" and then mount this directory into the container at the location "/config".
By doing so, the contents of host directory /scratch/DockerVolume/OHSVolume(and hence custom_mod_wl_ohs.conf) will become available in the container at the mount point.
This mounting can be done by using the -v option with the 'docker run' command as shown below. The following command will start the OHS container with oracle/ohs:12.2.1.3.0 image and the host directory "/scratch/DockerVolume/OHSVolume" will get mounted at the location "/config" in the container:
This mounting can be done by using the -v option with the 'docker run' command as shown below. The following command will start the OHS container with oracle/ohs:12.2.1.4.0 image and the host directory "/scratch/DockerVolume/OHSVolume" will get mounted at the location "/config" in the container:

$ docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -v /scratch/DockerVolume/OHSVolume:/config -w /config -d --name ohs -p 7777:7777 oracle/ohs:12.2.1.3.0
$ docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -v /scratch/DockerVolume/OHSVolume:/config -w /config -d --name ohs -p 7777:7777 oracle/ohs:12.2.1.4.0

### Stopping the OHS instance
To stop the OHS instance, execute the following command:

docker stop ohs (Assuming the name of conatiner is 'ohs')


To look at the Docker Container logs run:
To look at the Container logs run:

$ docker logs --details <Container-id>


## Support
Oracle HTTP Server on Docker is supported by Oracle.
Oracle HTTP Server in containers is supported by Oracle.


## License
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.
To download and run Oracle HTTP Server 12c Distribution regardless of inside or outside a container, and regardless of the distribution, you must download the binaries from Oracle website and accept the license indicated at that page.

To download and run Oracle JDK regardless of inside or outside a Docker container, you must download the binary from Oracle website and accept the license indicated at that pge.
To download and run Oracle JDK regardless of inside or outside a container, you must download the binary from Oracle website and accept the license indicated at that pge.

All scripts and files hosted in this project and GitHub [docker/OracleHTTPServer](./) repository required to build the Docker images are, unless otherwise noted, released under the Universal Permissive License v1.0.
All scripts and files hosted in this project and GitHub [docker/OracleHTTPServer](./) repository required to build the images are, unless otherwise noted, released under the Universal Permissive License v1.0.

## Copyright
Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
#
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.


#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# ORACLE HTTP Server DOCKERFILES PROJECT
# -----------------------------------------
# This is the DockerFile for Oracle HTTP Server 12.2.1.3.0
# This is the DockerFile for Oracle HTTP Server 12.2.1.4.0
#
# IMPORTANT
# -------------------------------------------
# The resulting image of this Dockerfile would have Oracle Linux 7 and Oracle HTTP Server 12.2.1.3.0 installed in standalone mode.
# The resulting image of this Dockerfile would have Oracle Linux 7 and Oracle HTTP Server 12.2.1.4.0 installed in standalone mode.

# A standalone domain will be configured in this image
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) fmw_12.2.1.3.0_ohs_linux64_Disk1_1of1.zip
# (1) fmw_12.2.1.4.0_ohs_linux64_Disk1_1of1.zip
# Download from http://www.oracle.com/technetwork/middleware/webtier/downloads/index-jsp-156711.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# As root user run following command manually:
#
# $ sh buildDockerImage.sh -v 12.2.1.3.0
# $ sh buildDockerImage.sh -v 12.2.1.4.0
#
# Alternatively you can also run
#
# $ docker build --force-rm=true --no-cache=true --rm=true -t oracle/$IMAGE_NAME:$VERSION-$INSTALL_TYPE .
#
# For example
#
# $ docker build --force-rm=true --no-cache=true --rm=true -t oracle/ohs:12.2.1.3.0 .
# $ docker build --force-rm=true --no-cache=true --rm=true -t oracle/ohs:12.2.1.4.0 .
#
# Pull serverjre:8 base image
# -----------------------------------
Expand All @@ -45,8 +45,8 @@ MAINTAINER Prabhat Kishore <prabhat.kishore@oracle.com>

# Environment variables required for this build (do NOT change)
# ----------------------------------------------
ENV OHS_PKG=fmw_12.2.1.3.0_ohs_linux64_Disk1_1of1.zip \
OHS_BIN=fmw_12.2.1.3.0_ohs_linux64.bin \
ENV OHS_PKG=fmw_12.2.1.4.0_ohs_linux64_Disk1_1of1.zip \
OHS_BIN=fmw_12.2.1.4.0_ohs_linux64.bin \
ORACLE_HOME=/u01/oracle/ohssa \
PATH=$PATH:/usr/java/default/bin:/u01/oracle/ohssa/oracle_common/common/bin \
NM_PORT=5556 \
Expand All @@ -64,7 +64,7 @@ ENV OHS_PKG=fmw_12.2.1.3.0_ohs_linux64_Disk1_1of1.zip \
# -------------------------------------------------------
COPY $OHS_PKG install.file oraInst.loc /u01/

# Install OL7 required packages. Refer FMW 12.2.1.3 System requirements guide for complete list of packages
# Install OL7 required packages. Refer FMW 12.2.1.4 System requirements guide for complete list of packages
# Setup filesystem and oracle user
#---------------------------------------------------------------------------------------------------------
RUN yum install -y unzip libaio sysstat make psmisc gcc && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# Author: hemastuti.baruah@oracle.com
#
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
#
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
Expand All @@ -17,7 +17,7 @@
ohs_ssl_port = (os.environ.get("OHS_SSL_PORT", "3333"))
ohs_comp_name = os.environ.get("OHS_COMPONENT_NAME", "ohs1")
domain_name = os.environ.get("DOMAIN_NAME", "ohsDomain")
domain_path = '/u01/oracle/ohssa/user_projects/domains/' + domain_name
domain_path = os.environ.get("DOMAIN_HOME", "/temp")
# Select OHS standalone template
# ==============================================
setTopologyProfile('Compact')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
Expand All @@ -8,7 +8,7 @@
#
#
#Refer to OHS documentation for more details and examples
#Section 2.4 @ http://docs.oracle.com/middleware/12213/webtier/develop-plugin/oracle.htm#PLGWL553
#Section 2.4 @ https://docs.oracle.com/en/middleware/fusion-middleware/web-tier/12.2.1.4/develop-plugin/oracle.html#GUID-A463B189-DF47-4932-8B96-FD4F5FEC8D56
#*************************************************************************
LoadModule weblogic_module "/u01/oracle/ohssa/ohs/modules/mod_wl_ohs.so"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
# Author: prabhat.kishore@oracle.com
# Copyright (c) 2017-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
Expand All @@ -17,7 +16,7 @@
function _term() {
echo "Stopping container."
echo "SIGTERM received, shutting down the server!"
${WLST_HOME}/wlst.sh /u01/oracle/container-scripts/stop-ohs.py
${WLST_HOME}/wlst.sh /u01/oracle/stop-ohs.py
${DOMAIN_HOME}/bin/stopNodeManager.sh
}

Expand All @@ -41,12 +40,12 @@ echo "OHS_COMPONENT_NAME=${OHS_COMPONENT_NAME:?"Please set OHS_COMPONENT_NAME"}"
export MW_HOME ORACLE_HOME DOMAIN_NAME OHS_COMPONENT_NAME


#Set WL_HOME, WLST_HOME, DOMAIN_HOME and NODEMGR_HOME
#Set WL_HOME, WLST_HOME, DOMAIN_HOME, NODEMGR_HOME, and LOGS_DIR
WL_HOME=${ORACLE_HOME}/wlserver
WLST_HOME=${ORACLE_HOME}/oracle_common/common/bin
echo "WLST_HOME=${WLST_HOME}"

DOMAIN_HOME=${ORACLE_HOME}/user_projects/domains/${DOMAIN_NAME}
DOMAIN_HOME=${ORACLE_HOME}/ohssa/user_projects/domains/${DOMAIN_NAME}
mriccell marked this conversation as resolved.
Show resolved Hide resolved
export DOMAIN_HOME
echo "DOMAIN_HOME=${DOMAIN_HOME}"

Expand All @@ -58,13 +57,18 @@ PATH=$PATH:/usr/java/default/bin:/u01/oracle/ohssa/oracle_common/common/bin
export PATH
echo "PATH=${PATH}"

LOG_DIR=${ORACLE_HOME}/logs
export LOG_DIR
echo "LOG_DIR=${LOG_DIR}"

# Set JAVA_OPTIONS and JAVA_HOME for node manager
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.RootDirectory=${DOMAIN_HOME}"
export JAVA_OPTIONS

JAVA_HOME=${ORACLE_HOME}/oracle_common/jdk/jre
export JAVA_HOME

mkdir -p $ORACLE_HOME/bootdir
PROPERTIES_FILE=/u01/oracle/bootdir/domain.properties
export PROPERTIES_FILE

Expand Down Expand Up @@ -96,23 +100,58 @@ if [ -z "$NM_PASSWORD" ]; then
exit
fi

wlst.sh -skipWLSModuleScanning -loadProperties $PROPERTIES_FILE /u01/oracle/container-scripts/create-sa-ohs-domain.py
wlst.sh -skipWLSModuleScanning -loadProperties $PROPERTIES_FILE /u01/oracle/create-sa-ohs-domain.py
# Set the NM username and password in the properties file
echo "username=$NM_USER" >> /u01/oracle/ohssa/user_projects/domains/ohsDomain/config/nodemanager/nm_password.properties
echo "password=$NM_PASSWORD" >> /u01/oracle/ohssa/user_projects/domains/ohsDomain/config/nodemanager/nm_password.properties
mv /u01/oracle/container-scripts/helloWorld.html ${ORACLE_HOME}/user_projects/domains/ohsDomain/config/fmwconfig/components/OHS/ohs1/htdocs/helloWorld.html
echo "username=$NM_USER" >> ${DOMAIN_HOME}/config/nodemanager/nm_password.properties
echo "password=$NM_PASSWORD" >> ${DOMAIN_HOME}/config/nodemanager/nm_password.properties
mv /u01/oracle/helloWorld.html ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/htdocs/helloWorld.html

echo "Copying Configuration to OHS Instance"
cp -L /u01/oracle/config/moduleconf/*.conf ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/moduleconf && find ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/moduleconf -name '.*' | xargs rm -rf

conf=$(ls -l /u01/oracle/config/httpd/*.conf 2>/dev/null | wc -l)
if [ $conf -gt 0 ]
mriccell marked this conversation as resolved.
Show resolved Hide resolved
then
echo "Copying root .conf files $OHS_COMPONENT_NAME"
cp -L /u01/oracle/config/httpd/*.conf ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME
fi

htdocs=$(ls -l /u01/oracle/config/htdocs/*.html 2>/dev/null | wc -l)
if [ $htdocs -gt 0 ]
mriccell marked this conversation as resolved.
Show resolved Hide resolved
then
echo "Copying htdocs to OHS Instance"
cp -L /u01/oracle/config/htdocs/*.html ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/htdocs
fi

if [ "$DEPLOY_WG" = "true" ]
then
echo "Deploying Webgate"
cd $ORACLE_HOME/webgate/ohs/tools/deployWebGate/
./deployWebGateInstance.sh -w ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME -oh $ORACLE_HOME
cd $ORACLE_HOME/webgate/ohs/tools/setup/InstallTools
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
./EditHttpConf -w ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME -oh $ORACLE_HOME
echo "Adding OAP API exclusion to webgate.conf"
echo "<LocationMatch \"/iam/access/binding/api/v10/oap\">" >> ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/webgate.conf
echo " require all granted" >> ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/webgate.conf
echo "</LocationMatch>" >> ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/webgate.conf
cp -rL /u01/oracle/config/webgate ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME && find ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/webgate -name '.*' | xargs rm -rf
else
echo "Dont Deploy WG"
fi

fi

# Start node manager
${DOMAIN_HOME}/bin/startNodeManager.sh > /u01/oracle/logs/nodemanager$$.log 2>&1 &
mkdir ${LOG_DIR}
${DOMAIN_HOME}/bin/startNodeManager.sh > ${LOG_DIR}/nodemanager$$.log 2>&1 &
statusfile=/tmp/notifyfifo.$$

#Check if Node Manager is up and running by inspecting logs
mkfifo "${statusfile}" || exit 1
{
# run tail in the background so that the shell can kill tail when notified that grep has exited
tail -f /u01/oracle/logs/nodemanager$$.log &
tail -f ${LOG_DIR}/nodemanager$$.log &
# remember tail's PID
tailpid=$!
# wait for notification that grep has exited
Expand All @@ -123,7 +162,7 @@ mkfifo "${statusfile}" || exit 1
} | {
grep -m 1 "Secure socket listener started on port 5556"
# notify the first pipeline stage that grep is done
echo "RUNNING"> /u01/oracle/logs/Nodemanage$$.status
echo "RUNNING"> ${LOG_DIR}/Nodemanage$$.status
echo "Node manager is running"
echo >${statusfile}
}
Expand All @@ -136,9 +175,9 @@ configureWLSProxyPlugin.sh
fi

#Start OHS component only if Node Manager is up
if [ -f /u01/oracle/logs/Nodemanage$$.status ]; then
if [ -f ${LOG_DIR}/Nodemanage$$.status ]; then
echo "Node manager running, hence starting OHS server"
${WLST_HOME}/wlst.sh -loadProperties $PROPERTIES_FILE /u01/oracle/container-scripts/start-ohs.py
${WLST_HOME}/wlst.sh -loadProperties $PROPERTIES_FILE /u01/oracle/start-ohs.py
echo "OHS server has been started "
fi

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@

# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# Author: hemastuti.baruah@oracle.com
# Starts the ohs1 component server inside the ohsDomain

#
import os, sys
java_home = os.environ.get("JAVA_HOME", "/usr/java/default")
ohs_comp_name = os.environ.get("OHS_COMPONENT_NAME", "ohs1")
domain_name = os.environ.get("DOMAIN_NAME", "ohsDomain")
domain_path = '/u01/oracle/ohssa/user_projects/domains/' + domain_name
domain_path = os.environ.get("DOMAIN_HOME", "temp")
oracle_home = os.environ.get("ORACLE_HOME", "/u01/oracle/ohssa")
######################################################
try:
Expand Down
Loading