diff --git a/OracleHTTPServer/COPYRIGHT b/OracleHTTPServer/COPYRIGHT index 3b1931c0b4..1c601b10fe 100644 --- a/OracleHTTPServer/COPYRIGHT +++ b/OracleHTTPServer/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright (c) 2020, 2024, Oracle and/or its affiliates. +Copyright (c) 2020, 2025, 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 diff --git a/OracleHTTPServer/README.md b/OracleHTTPServer/README.md index 168058c5d5..56b6d73cb7 100644 --- a/OracleHTTPServer/README.md +++ b/OracleHTTPServer/README.md @@ -1,9 +1,11 @@ # 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). +This project includes quick start dockerfiles and samples for standalone Oracle HTTP Server 12.2.1.4.0 and JDK 8 and 14.1.2.0.0 JDK 17 and 21 based on Oracle Linux 8 and 9. 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. +The samples in this repository are for trial use cases only. For alternative methods, we suggest obtaining base Oracle HTTP Server images from the [Oracle Container Registry](https://container-registry.oracle.com/), using the open source [WebLogic Image Tool](https://oracle.github.io/weblogic-image-tool) to create custom images. + ## How to Build and Run This project offers Dockerfile for Oracle HTTP Server in standalone mode. To assist in building the images, you can use the buildDockerImage.sh script. See below for instructions and usage @@ -68,4 +70,4 @@ To download and run Oracle JDK regardless of inside or outside a container, you 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, 2024, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/Dockerfile b/OracleHTTPServer/dockerfiles/14.1.2.0.0/Dockerfile new file mode 100644 index 0000000000..42c762751b --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/Dockerfile @@ -0,0 +1,96 @@ +# +# Copyright (c) 2025 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 14.1.2.0.0 +# +# IMPORTANT +# ------------------------------------------- +# The resulting image of this Dockerfile would have Oracle Linux 8 and 9 and Oracle HTTP Server 14.1.2.0.0 installed in standalone mode. + +# A standalone domain will be configured in this image +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) V1045136-01.zip Oracle HTTP Server 14.1.2.0 for Linux x86-64 installer +# Download from http://www.oracle.com/technetwork/middleware/webtier/downloads/index-jsp-156711.html +# unzip you will need the OHS installer (bin file) fmw_14.1.2.0.0_ohs_linux64.bin +# +# +# 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 14.1.2.0.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:14.1.2.0.0 . +# +# Pull JDK 17 image from OCR as base image +# ----------------------------------------- +FROM container-registry.oracle.com/java/jdk:17.0.14 + +# Environment variables required for this build (do NOT change) +# ---------------------------------------------- +ENV OHS_PKG=V1045136-01.zip +ENV OHS_BIN=fmw_14.1.2.0.0_ohs_linux64.bin +ENV ORACLE_HOME=/u01/oracle +ENV NM_PORT=5556 +ENV OHS_LISTEN_PORT=7777 +ENV OHS_SSL_PORT=4443 +ENV JAVA_HOME=/usr/java/default +ENV DOMAIN_NAME=ohsDomain +ENV OHS_COMPONENT_NAME=ohs1 +ENV PATH=${PATH}:${ORACLE_HOME}:/usr/java/default/bin:${ORACLE_HOME}/oracle_common/common/bin:${ORACLE_HOME}/user_projects/domains/ohsDomain/bin +ENV WLST_HOME=/u01/oracle/oracle_common/common/bin + + +# Copy packages to the new drive +# ------------------------------------------------------- +COPY ${OHS_PKG} install.file oraInst.loc /u01/ + +# Install OL 8 or OL 9 required packages. Refer FMW 14.1.2.0.0 System requirements guide for complete list of packages +# Setup filesystem and oracle user +#--------------------------------------------------------------------------------------------------------- +RUN yum install -y unzip libaio sysstat make psmisc gcc && \ + yum clean all && \ + chmod a+xr /u01 && \ + useradd -b /u01 -m -s /bin/bash oracle && \ + mkdir /u01/oracle/.inventory /u01/oracle/bootdir && \ + chown oracle:oracle -R /u01 + +# Go to /u01 as user 'oracle' to proceed with OHS installation +#-------------------------------------------------------- +USER oracle +WORKDIR /u01 +#RUN unzip -q /u01/${OHS_PKG} && cd - && \ +RUN unzip -q /u01/${OHS_PKG} && \ + /u01/${OHS_BIN} -silent -novalidation -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc ORACLE_HOME=${ORACLE_HOME} && \ + rm /u01/${OHS_BIN} /u01/oraInst.loc /u01/install.file && \ + mkdir -p /u01/oracle/logs && \ + chown oracle:oracle -R /u01/oracle/logs + +# Copy required files to build this image +# ------------------------------------------------------ +COPY container-scripts/* /u01/oracle/ + +#Expose all Ports +EXPOSE ${OHS_SSL_PORT} ${OHS_LISTEN_PORT} ${NM_PORT} + +# Final setup +USER oracle +WORKDIR ${ORACLE_HOME} + +# Provision OHS instance +CMD ["/u01/oracle/provisionOHS.sh"] diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/V1045136-01.zip.download b/OracleHTTPServer/dockerfiles/14.1.2.0.0/V1045136-01.zip.download new file mode 100644 index 0000000000..23fa4ef2df --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/V1045136-01.zip.download @@ -0,0 +1,12 @@ +# +# Copyright (c) 2025 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. +# +# +# Download the OHS 14.1.2.0.0 software for LINUX.x64 (V1045136-01.zip) +# +# from http://www.oracle.com/technetwork/middleware/webtier/downloads/index-jsp-156711.html +# +# +6f5fbc72f151426a8cca775bed058b2d V1045136-01.zip diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/configureWLSProxyPlugin.sh b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/configureWLSProxyPlugin.sh new file mode 100755 index 0000000000..84fa47facd --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/configureWLSProxyPlugin.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# Author: hemastuti.baruah@oracle.com +# +# Copyright (c) 2025 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. +# +#************************************************************************* +#This script will configure Oracle WebLogic Server Proxy Plug-In (mod_wl_ohs), +#in order to enable the Oracle HTTP Server instances to route applications +#deployed on the Admin Server, Single Managed Server or the Oracle WebLogic Server clusters +# +#Prerequisite: +#1.Create a directory which would be mounted to the container +#2.Create "custom_mod_wl_ohs.conf" as per your environment by referring to mod_wl_ohs.conf sample file and OHS document above +#3.Place the "custom_mod_wl_ohs.conf" inside the directory which will be mounted in the container +#4.During OHS container creation mount the directory which contains the "custom_mod_wl_ohs.conf" +# +# Note : +# If custom_mod_wl_ohs.conf is not provided, WebLogic Server Proxy Plug-In will not be configured. But OHS server will be still running. +# User may login to OHS container and manually configure the WebLogic Server Proxy Plug-In later +# +#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 "ohs1" +#************************************************************************* +echo "ORACLE_HOME=${ORACLE_HOME:?"Please set MW_HOME"}" +echo "DOMAIN_NAME=${DOMAIN_NAME:?"Please set DOMAIN_NAME"}" +echo "OHS_COMPONENT_NAME=${OHS_COMPONENT_NAME:?"Please set OHS_COMPONENT_NAME"}" + +DOMAIN_HOME=${ORACLE_HOME}/user_projects/domains/${DOMAIN_NAME} +INSTANCE_CONFIG_HOME=$DOMAIN_HOME/config/fmwconfig/components/OHS/${OHS_COMPONENT_NAME} +export INSTANCE_CONFIG_HOME +echo "INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}" + +#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 +echo "MODWLSCONFIGFILE IS ${modwlsconfigfile}" + +# Check and copy custom_mod_wl_ohs.conf to OHS Instance Home +if [[ -n "${modwlsconfigfile/[ ]*\n/}" ]]; then +cd ${INSTANCE_CONFIG_HOME} || exit +mv mod_wl_ohs.conf mod_wl_ohs.conf.ORIGINAL +echo "Copying ${modwlsconfigfile} to ${INSTANCE_CONFIG_HOME} " +cp ${modwlsconfigfile} ${INSTANCE_CONFIG_HOME}/mod_wl_ohs.conf +fi diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/create-sa-ohs-domain.py b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/create-sa-ohs-domain.py new file mode 100755 index 0000000000..ca70d82191 --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/create-sa-ohs-domain.py @@ -0,0 +1,59 @@ +#!/usr/bin/python +# +# Copyright (c) 2025 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. +# +# Create OHS Domain and OHS System component +# +# OHS Domain 'ohsDomain' (or anything defined under DOMAIN_NAME) to be created inside the Docker image for OHS +# OHS System Component "ohs1" (Or anything defined under OHS_COMPONENT_NAME)to be created inside the Docker image for OHS +# +# Author: hemastuti.baruah@oracle.com +# ============================================== +import os, sys +#admin_port = (os.environ.get("ADMIN_PORT", "7001")) +ohs_http_port = (os.environ.get("OHS_LISTEN_PORT", "7777")) +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 = os.environ.get("DOMAIN_HOME", "/u01/oracle/user_projects/domains/ohsDomain") + +print('domain_name : [%s]' % domain_name); +print('domain_path : [%s]' % domain_path); +print('ohs_comp_name : [%s]' % ohs_comp_name); + +# Select OHS standalone template +# ============================================== +setTopologyProfile('Compact') +selectTemplate('Oracle HTTP Server (Standalone)') +loadTemplates() +showTemplates() +# Create OHS System Component by the name ohs1, Configure OHS Listen Port and SSL Port +# ====================================================================== +cd('/') +cd('SystemComponent/' + ohs_comp_name) +set('ComponentType','OHS') +cd('/') +cd('OHS/' + ohs_comp_name) +set('ListenAddress','') +set('ListenPort', ohs_http_port) +set('SSLListenPort', ohs_ssl_port) +# Set NodeManager user name and password +# ====================================================================== +cd('/') +create('sc', 'SecurityConfiguration') +cd('SecurityConfiguration/sc') +set('NodeManagerUsername', username) +set('NodeManagerPasswordEncrypted', password) +#set('NodeManagerUsername','weblogic') +#set('NodeManagerPasswordEncrypted','welcome1') +setOption('NodeManagerType','PerDomainNodeManager') +setOption('OverwriteDomain', 'true') +#Write Domain, close template and exit +# ====================================================================== +#writeDomain(r'/u01/oracle/user_projects/domains/ohsDomain') +writeDomain(domain_path) +dumpStack() +closeTemplate() +exit() diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/helloWorld.html b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/helloWorld.html new file mode 100644 index 0000000000..046d862c27 --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/helloWorld.html @@ -0,0 +1,12 @@ + + + + + Oracle HHTP Server Test + + + +

Oracle HTTP Server Test

+

Welcome to Hello World!!! Test is successful

+ + diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/mod_wl_ohs.conf.sample b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/mod_wl_ohs.conf.sample new file mode 100644 index 0000000000..0eec328461 --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/mod_wl_ohs.conf.sample @@ -0,0 +1,40 @@ +# Copyright (c) 2025 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. +# +#*************************************************************** +# NOTE : This is a sample template to configure mod_weblogic. +# Author: hemastuti.baruah@oracle.com +# +# +#Refer to OHS documentation for more details and examples +#Section 2.4 @ https://docs.oracle.com/en/middleware/fusion-middleware/web-tier/14.1.2/develop-plugin/oracle.html#GUID-A463B189-DF47-4932-8B96-FD4F5FEC8D56 +#************************************************************************* +LoadModule weblogic_module "/u01/oracle/ohs/modules/mod_wl_ohs.so" + + +WebLogicHost WEBLOGIC_HOST +WebLogicPort WEBLOGIC_PORT + + +# Directive for weblogic admin Console deployed on Weblogic Admin Server + +SetHandler weblogic-handler +WebLogicHost WEBLOGIC_HOST +WeblogicPort WEBLOGIC_PORT + + +# Directive for all application deployed on weblogic cluster with /weblogic prepath +#All application deployed on cluster can be accessed via http://myhost:7777/weblogic/application_end_url + +WLSRequest On +WebLogicCluster WEBLOGIC_CLUSTER +PathTrim /weblogic + + +#Directive for application deployed on single or set of Managed Servers (and NOT on weblogic cluster) +# +#SetHandler weblogic-handler +#WebLogicHost ManagedServer_HOST +#WeblogicPort ManagedServer_PORT +# diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/provisionOHS.sh b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/provisionOHS.sh new file mode 100755 index 0000000000..1adf570b98 --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/provisionOHS.sh @@ -0,0 +1,208 @@ +#!/bin/bash +# Copyright (c) 2025 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. +# +#************************************************************************* +# This script is used to create a standalone OHS domain and start NodeManager, OHS instance. +# This script sets the following variables: +# +# WL_HOME - The Weblogic home directory +# NODEMGR_HOME - Absolute path to Nodemanager directory under the configured domain home +# DOMAIN_HOME - Absolute path to configured domain home +# JAVA_HOME- Absolute path to jre inside the oracle home directory +#************************************************************************* +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down the server!" + ${WLST_HOME}/wlst.sh /u01/oracle/stop-ohs.py + ${DOMAIN_HOME}/bin/stopNodeManager.sh +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down the server!" + kill -9 $childPID +} + +# Set SIGTERM handler +trap _term SIGTERM + +echo "ORACLE_HOME=${ORACLE_HOME:?"Please set ORACLE_HOME"}" +echo "DOMAIN_NAME=${DOMAIN_NAME:?"Please set DOMAIN_NAME"}" +echo "OHS_COMPONENT_NAME=${OHS_COMPONENT_NAME:?"Please set OHS_COMPONENT_NAME"}" + +export ORACLE_HOME DOMAIN_NAME OHS_COMPONENT_NAME + + +#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} +export DOMAIN_HOME +echo "DOMAIN_HOME=${DOMAIN_HOME}" + +NODEMGR_HOME=${DOMAIN_HOME}/nodemanager +export NODEMGR_HOME + + +PATH=$PATH:${ORACLE_HOME}:/usr/java/default/bin:${ORACLE_HOME}/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 + +if [ ! -e "$PROPERTIES_FILE" ]; then + echo "A properties file with the username and password needs to be supplied." + exit +fi + +# If nodemanager$$.log does not exists,this is the first time configuring the NM +# generate the NM password + +if [ ! -f /u01/oracle/logs/nodemanager$$.log ]; then + +# Get Username +NM_USER=`awk '{print $1}' $PROPERTIES_FILE | grep username | cut -d "=" -f2` +if [ -z "$NM_USER" ]; then + echo "The Node Manager username is blank. It must be set in the properties file." + exit +fi + +# Get Password +NM_PASSWORD=`awk '{print $1}' $PROPERTIES_FILE | grep password | cut -d "=" -f2` +if [ -z "$NM_PASSWORD" ]; then + echo "The Node Manager password is blank. It must be set in the properties file." + exit +fi + +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" >> ${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" +conf=$(ls -l /u01/oracle/config/moduleconf/*.conf 2>/dev/null | wc -l) +if [ $conf -gt 0 ] +then + echo " Copying moduleconf conf files 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 '.*' -exec rm -rf {} \; > /dev/null 2>&1 +fi + +conf=$(ls -l /u01/oracle/config/httpd/*.conf 2>/dev/null | wc -l) +if [ $conf -gt 0 ] +then + echo " Copying root conf files OHS Instance" + cp -L /u01/oracle/config/httpd/*.conf ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME + find ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME -name '.*' -exec rm -rf {} \; > /dev/null 2>&1 +fi + +conf=$(ls -l /u01/oracle/config/wallet/* 2>/dev/null | wc -l) +if [ $conf -gt 0 ] +then + echo " Copying OHS Wallets to OHS Instance" + mkdir -p ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/keystores > /dev/null 2>&1 + cp -Lr /u01/oracle/config/wallet/* ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/keystores/ + find ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/keystores -name '.*' -exec rm -rf {} \; > /dev/null 2>&1 +fi + +htdocs=$(ls -l /u01/oracle/config/htdocs/* 2>/dev/null | wc -l) +if [ $htdocs -gt 0 ] +then + echo " Copying htdocs to OHS Instance" + cp -Lr /u01/oracle/config/htdocs/* ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/htdocs + find ${DOMAIN_HOME}/config/fmwconfig/components/OHS/$OHS_COMPONENT_NAME/htdocs -name '.*' -exec rm -rf {} \; > /dev/null 2>&1 +fi + +if [ "$DEPLOY_WG" = "true" ] +then + echo "Deploying Webgate" + if ! [ -e /u01/oracle/config/webgate/config/ObAccessClient.xml ] + then + echo "Must provide WebGate Configutaion files when DEPLOY_WG is true." + exit 1 + fi + cd $ORACLE_HOME/webgate/ohs/tools/deployWebGate/ || exit + ./deployWebGateInstance.sh -w ${DOMAIN_HOME}/config/fmwconfig/components/OHS/${OHS_COMPONENT_NAME} -oh $ORACLE_HOME + cd $ORACLE_HOME/webgate/ohs/tools/setup/InstallTools || exit + 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 "" >> ${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 "" >> ${DOMAIN_HOME}/config/fmwconfig/components/OHS/${OHS_COMPONENT_NAME}/webgate.conf + echo "" >> ${DOMAIN_HOME}/config/fmwconfig/components/OHS/${OHS_COMPONENT_NAME}/webgate.conf + echo "" >> ${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 "" >> ${DOMAIN_HOME}/config/fmwconfig/components/OHS/${OHS_COMPONENT_NAME}/webgate.conf + echo " Copying WebGate Artifacts to Oracle Instance" + 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 '.*' -exec rm -rf {} \; > /dev/null 2>&1 +else + echo "WebGate not deployed" +fi + +fi + +# Start node manager +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 ${LOG_DIR}/nodemanager$$.log & + # remember tail's PID + tailpid=$! + # wait for notification that grep has exited + read templine <${statusfile} + echo ${templine} + # grep has exited, time to go + kill "${tailpid}" +} | { + grep -m 1 "Secure socket listener started on port 5556" + # notify the first pipeline stage that grep is done + echo "RUNNING"> ${LOG_DIR}/Nodemanage$$.status + echo "Node manager is running" + echo >${statusfile} +} +# clean up temporary files +rm "${statusfile}" + +#Check if configureWLSProxyPlugin.sh needs to be invoked +if [ -f /config/custom_mod_wl_ohs.conf ]; then + configureWLSProxyPlugin.sh +fi + +#Start OHS component only if Node Manager is up +if [ -f ${LOG_DIR}/Nodemanage$$.status ]; then +echo "Node manager running, hence starting OHS server" +${WLST_HOME}/wlst.sh -loadProperties $PROPERTIES_FILE /u01/oracle/start-ohs.py +echo "OHS server has been started" +fi + +#Tail all server logs +tail -f ${DOMAIN_HOME}/nodemanager/nodemanager.log ${DOMAIN_HOME}/servers/*/logs/*.log & + +childPID=$! +wait $childPID diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/start-ohs.py b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/start-ohs.py new file mode 100755 index 0000000000..765657ad6c --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/start-ohs.py @@ -0,0 +1,31 @@ +# Copyright (c) 2025 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 = os.environ.get("DOMAIN_HOME", "/u01/oracle/user_projects/domains/ohsDomain") +oracle_home = os.environ.get("ORACLE_HOME", "/u01/oracle") +###################################################### +try: + JAVA_HOME = java_home + DOMAIN_HOME = domain_path + ORACLE_HOME = oracle_home + if DOMAIN_HOME is None: + sys.exit("Error: Please set the environment variable DOMAIN_HOME") + if JAVA_HOME is None: + sys.exit("Error: Please set the environment variable JAVA_HOME") + if ORACLE_HOME is None: + sys.exit("Error: Please set the environment variable ORACLE_HOME") +except (KeyError), why: + sys.exit("Error: Missing Environment Variables " + str(why)) +nmConnect(username=username,password=password,domainName=domain_name) +nmServerStatus(serverName=ohs_comp_name,serverType='OHS') +nmStart(serverName=ohs_comp_name,serverType='OHS') +nmServerStatus(serverName=ohs_comp_name,serverType='OHS') +exit() diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/stop-ohs.py b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/stop-ohs.py new file mode 100755 index 0000000000..d9d77f6b34 --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/container-scripts/stop-ohs.py @@ -0,0 +1,31 @@ +# Copyright (c) 2025 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 +# Stops 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 = os.environ.get("DOMAIN_HOME", "/u01/oracle/user_projects/domains/ohsDomain") +oracle_home = os.environ.get("ORACLE_HOME", "/u01/oracle") +###################################################### +try: + JAVA_HOME = java_home + DOMAIN_HOME = domain_path + ORACLE_HOME = oracle_home + if DOMAIN_HOME is None: + sys.exit("Error: Please set the environment variable DOMAIN_HOME") + if JAVA_HOME is None: + sys.exit("Error: Please set the environment variable JAVA_HOME") + if ORACLE_HOME is None: + sys.exit("Error: Please set the environment variable ORACLE_HOME") +except (KeyError), why: + sys.exit("Error: Missing Environment Variables " + str(why)) +nmConnect(username,password,domainName=domain_name) +nmServerStatus(serverName=ohs_comp_name,serverType='OHS') +nmKill(serverName=ohs_comp_name,serverType='OHS') +nmServerStatus(serverName=ohs_comp_name,serverType='OHS') +exit() diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/install.file b/OracleHTTPServer/dockerfiles/14.1.2.0.0/install.file new file mode 100644 index 0000000000..966e3e7e5c --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/install.file @@ -0,0 +1,24 @@ +# +# Copyright (c) 2025 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. +# +[ENGINE] + +#DO NOT CHANGE THIS. +Response File Version=1.0.0.0.0 + +[GENERIC] + +#Set this to true if you wish to skip software updates +DECLINE_AUTO_UPDATES=true + +#Set this variable value to the Installation Type selected as either Standalone HTTP Server (Managed independently of WebLogic server) OR Colocated HTTP Server (Managed through WebLogic server) +INSTALL_TYPE=Standalone HTTP Server (Managed independently of WebLogic server) + +#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration +DECLINE_SECURITY_UPDATES=true + +#Set this to true if My Oracle Support Password is specified +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false + diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/oraInst.loc b/OracleHTTPServer/dockerfiles/14.1.2.0.0/oraInst.loc new file mode 100644 index 0000000000..8cba0e0866 --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/oraInst.loc @@ -0,0 +1,7 @@ +# +# Copyright (c) 2025 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. +# +inventory_loc=/u01/oracle/.inventory +inst_group=oracle diff --git a/OracleHTTPServer/dockerfiles/14.1.2.0.0/properties/domain.properties b/OracleHTTPServer/dockerfiles/14.1.2.0.0/properties/domain.properties new file mode 100644 index 0000000000..6d0dd2744a --- /dev/null +++ b/OracleHTTPServer/dockerfiles/14.1.2.0.0/properties/domain.properties @@ -0,0 +1,2 @@ +username=xxxxxxxxxx +password=xxxxxxxxxx diff --git a/OracleHTTPServer/dockerfiles/buildDockerImage.sh b/OracleHTTPServer/dockerfiles/buildDockerImage.sh index 090d3042a8..e7f2340042 100755 --- a/OracleHTTPServer/dockerfiles/buildDockerImage.sh +++ b/OracleHTTPServer/dockerfiles/buildDockerImage.sh @@ -24,7 +24,7 @@ Parameters: LICENSE Universal Permissive License v1.0 -Copyright (c) 2016, 2024 Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2016, 2025 Oracle and/or its affiliates. All rights reserved. EOF @@ -35,8 +35,9 @@ exit 0 # Validate packages checksumPackages() { echo "Checking if required packages are present and valid..." - # md5sum -c *.download - # if [ "$?" -ne 0 ]; then +# md5sum -c *.download +# +# if [ "$?" -ne 0 ]; then MDSUM="md5sum -c *.download" if [ "$MDSUM" -ne 0 ]; then echo "MD5 for required packages to build this image did not match!" diff --git a/OracleHTTPServer/samples/12214-patch/Dockerfile b/OracleHTTPServer/samples/12214-patch/Dockerfile index 84bd3748fe..ad884e6e87 100644 --- a/OracleHTTPServer/samples/12214-patch/Dockerfile +++ b/OracleHTTPServer/samples/12214-patch/Dockerfile @@ -1,6 +1,6 @@ # LICENSE UPL 1.0 # -# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2025 Oracle and/or its affiliates. All rights reserved. # # ORACLE DOCKERFILES PROJECT # -------------------------- diff --git a/OracleHTTPServer/samples/12214-patch/README.md b/OracleHTTPServer/samples/12214-patch/README.md index 15a843d4f6..259d7b11b1 100644 --- a/OracleHTTPServer/samples/12214-patch/README.md +++ b/OracleHTTPServer/samples/12214-patch/README.md @@ -44,4 +44,4 @@ To download and run Oracle JDK regardless of inside or outside a container, you 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) 2024 Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2025 Oracle and/or its affiliates. All rights reserved.