Oracle HTTP Server 14.1.2.0.0 on AWS User Guide
Overview
This guide covers launching and using the Oracle HTTP Server 14.1.2.0.0 on Oracle Linux 9 AMI from cloudimg on Amazon EC2. It is sold on AWS Marketplace as the listing Oracle HTTP Server 14.1.2 | cloudimg, which sells one product, Oracle HTTP Server 14.1.2 on Oracle Linux 9.
Oracle HTTP Server (OHS) is Oracle's web server for Oracle Fusion Middleware. Release 14.1.2.0.0 is based on Apache HTTP Server 2.4.62 and OpenSSL 3.0.15, and adds Oracle's own modules: mod_wl_ohs (the WebLogic Server proxy plug in, which load balances and fails over requests to WebLogic Server clusters), mod_ossl (TLS with Oracle wallets) and mod_security2. It is the usual front end for WebLogic Server, Oracle Fusion Middleware products and other application servers, and a capable web server for static content and reverse proxying on its own.
This image installs the Standalone HTTP Server install type ("Standalone HTTP Server (Managed independently of WebLogic server)"): Oracle HTTP Server runs in its own standalone domain, managed by its own Node Manager, with no WebLogic administration server.
The cloudimg image adds:
- A domain made on your instance, not on ours. The image contains the Oracle HTTP Server installation only. On the first boot of every instance, a one time service creates
base_domainfrom Oracle's own standalone template (ohs_standalone_template.jar) with a Node Manager password generated on that instance. The domain's encryption salt and its Node Manager credential are therefore unique to your instance, and no two instances share a credential. The password never appears on a command line or in a log; it is written to/root/ohs-credentials.txt(readable by root only). - Your own TLS certificate from the first boot. First boot generates an RSA 3072 bit, SHA-256 self signed certificate for your instance (its public DNS name, public and private addresses,
localhostand127.0.0.1) and puts it in the Oracle wallet Oracle HTTP Server serves, replacing Oracle's demo wallet. Port 443 serves HTTPS with TLS 1.2 and 1.3; port 80 answers with a permanent redirect to HTTPS. - Fail closed. Node Manager and Oracle HTTP Server refuse to start until first boot has finished. If first boot ever fails, the partial domain is removed and nothing listens on 80 or 443.
- Locked-down defaults. The Oracle HTTP Server admin port (
127.0.0.1:9999) and Node Manager (127.0.0.1:5556, SSL) listen on the loopback address only. Thehttpdprocesses run as the unprivilegedoracleuser, which binds ports 80 and 443 through one systemd capability (CAP_NET_BIND_SERVICE) and nothing else. HTTP TRACE is off. SSH by key only (no passwords, no root login, no X11 forwarding). Node Manager and everyhttpdprocess are blocked from the instance metadata service, so a proxy rule can never be used to read the instance's credentials, and the AMI requires IMDSv2. SELinux stays enforcing, theoracleaccount has no password, and firewalld allows only SSH, HTTP and HTTPS. - Base media only. Oracle HTTP Server is installed from Oracle's 14.1.2.0.0 release media (Oracle Software Delivery Cloud V1045136-01, verified by checksum). The only Oracle patches in the Oracle home are the two one off patches the installer itself applies (36964826 and 36990807); no PSU or other Oracle patch is applied, so you apply Oracle's patches with your own Oracle support (see Step 10).
- A Java runtime that dnf keeps patched. The Oracle HTTP Server tools (Node Manager, WLST, orapki, OPatch) run on Oracle Linux's own OpenJDK 21 (the
java-21-openjdk-headlesspackage from the Oracle Linux 9 AppStream) through the alternatives path/usr/lib/jvm/jre-21-openjdk. The Oracle JDK 17 that Oracle's installer places in the Oracle home is removed, andoracle_common/jdkis a link to the OpenJDK 21 runtime (Oracle certifies JDK 21 for Fusion Middleware 14.1.2). OpenJDK security updates install withdnflike any other package. - Fully patched Oracle Linux 9 at build time, with
dnf-automaticapplying Oracle Linux security updates (OpenJDK included) every day.
What is on the image: Oracle HTTP Server 14.1.2.0.0 (Standalone HTTP Server) in /u01/app/oracle/product/ohs, Oracle Linux OpenJDK 21 (java-21-openjdk-headless, JAVA_HOME /usr/lib/jvm/jre-21-openjdk), Oracle Linux 9 with the Unbreakable Enterprise Kernel, cloud-init and the AWS Systems Manager agent.
Default user: ec2-user · Architecture: x86_64 · Recommended instance type: m5.large
Licensing
Bring your own licence. Oracle HTTP Server is a commercial Oracle product. Using Oracle HTTP Server requires your own Oracle licence covering the instance under Oracle's cloud licensing policy; no Oracle licence is included.
Pricing: $0.04 per vCPU per hour for the cloudimg software (an m5.large has 2 vCPUs, so $0.08 per hour), plus AWS infrastructure charges. The charge is for what cloudimg adds to Oracle's base media: the standalone domain created on each instance at first boot with its own Node Manager password and encryption salt, the per-instance TLS certificate that replaces Oracle's demo wallet, the admin port and Node Manager on the loopback address only, SSH by key pair only, the Oracle HTTP Server processes blocked from the instance metadata service, and OpenJDK 21 kept patched through dnf; it does not include an Oracle licence.
The Java runtime is Oracle Linux's OpenJDK 21, open source (GPLv2 with the Classpath Exception) and patched through dnf; the image includes no Oracle JDK. If your Oracle support requires Oracle JDK, install it under your own Oracle entitlement and point the Oracle home at it (Step 10 shows how). The notices are in /usr/share/doc/cloudimg/licenses/ and the OpenJDK licence in /usr/lib/jvm/jre-21-openjdk/legal/java.base/.
Prerequisites
- An AWS account subscribed to the listing, an EC2 key pair and a VPC subnet with a route to the internet (or a private route you use for management).
- A security group that allows TCP 443 (HTTPS) and TCP 80 (redirects to HTTPS) from the people and systems that use your site, and TCP 22 (SSH) from your own networks only. Ports 9999 and 5556 are never needed in the security group.
Step 1: Launch the instance
Open the listing Oracle HTTP Server 14.1.2 | cloudimg on AWS Marketplace, choose View purchase options and Subscribe. When the subscription is active choose Launch your software, choose the software version Oracle HTTP Server 14.1.2 on Oracle Linux 9 and your Region. If the version list also shows an older Oracle Database 12.1 Enterprise version, that is the product this listing sold before and is not this image. Choose m5.large for production (a t3.medium is fine for testing), your key pair and a security group as above. The root volume holds the Oracle home, your domain, your content and the logs; give it room for them (for example 30 GiB). The root file system grows to fill the volume on first boot.
With the AWS CLI (replace the values in angle brackets):
aws ec2 run-instances --region <region> --image-id <ami-id-from-the-listing> \
--instance-type m5.large --key-name <your-key-pair> \
--security-group-ids <your-security-group> --subnet-id <your-subnet> \
--metadata-options HttpTokens=required,HttpEndpoint=enabled \
--block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=30,VolumeType=gp3}' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=oracle-http-server}]'
Step 2: Connect to your instance
| Version | SSH user |
|---|---|
| Oracle HTTP Server 14.1.2.0.0 on Oracle Linux 9 | ec2-user |
ssh -i <your-key.pem> ec2-user@<public-ip>
Confirm the operating system release:
cat /etc/oracle-release
Oracle Linux Server release 9.8
Step 3: Check the services
On a newly launched instance, first boot creates the domain, the Node Manager password and the TLS certificate, starts Oracle HTTP Server once to prove it answers over HTTPS with the new certificate, and then hands over to the services: Oracle HTTP Server is ready about one to two minutes after launch. Until then ports 80 and 443 refuse connections. Check the three units:
sudo systemctl is-active ohs-firstboot.service ohs-nodemanager.service ohs.service
active
active
active
ohs-firstboot.servicereportsactivebecause it is a one time unit that has finished; on later boots it sees its marker (/var/lib/cloudimg/ohs-firstboot.done) and does nothing.ohs-nodemanager.serviceis the domain's Node Manager, running asoracleand listening on127.0.0.1:5556only. It runs theohs1httpdprocesses and restarts them if they stop unexpectedly.ohs.servicestarts and stops the Oracle HTTP Server componentohs1through Node Manager (Oracle'sstartComponent.shandstopComponent.sh).
If ohs.service shows activating, wait a few seconds and run the command again. The first boot log shows the host name the instance was configured for and how long first boot took:
sudo cat /var/log/ohs-firstboot.log
[<timestamp>] ohs-firstboot: configured host: <public-dns>
[<timestamp>] ohs-firstboot: creating base_domain (WLST offline from Oracle's ohs_standalone_template.jar)
[<timestamp>] ohs-firstboot: TLS wallet, ServerName and cloudimg defaults for <public-dns>
[<timestamp>] ohs-firstboot: first start through a transient Node Manager (stores the Node Manager credentials for ohs.service)
[<timestamp>] ohs-firstboot: first start OK (https://<public-dns>/ answered 200 with this instance's certificate)
[<timestamp>] ohs-firstboot: done in <seconds>s; starting Node Manager and OHS
Step 4: Get your URL and Node Manager password
The values generated for this instance are in a root only file. sudo cat /root/ohs-credentials.txt prints all of it; this shows the file with the password hidden:
sudo sed -E 's/^(NODEMANAGER_PASSWORD=).*/\1<hidden>/' /root/ohs-credentials.txt
# Oracle HTTP Server 14.1.2.0.0 - this instance's own credentials (generated on its first boot)
# Generated: <timestamp>
NODEMANAGER_USER=nmadmin
NODEMANAGER_PASSWORD=<hidden>
NODEMANAGER_ADDRESS=localhost:5556
OHS_COMPONENT=ohs1
OHS_HTTPS_URL=https://<public-dns>/
OHS_HTTP_URL=http://<public-dns>/
ORACLE_HOME=/u01/app/oracle/product/ohs
DOMAIN_HOME=/u01/app/oracle/config/domains/base_domain
TLS_CERT_SHA256_FINGERPRINT=<sha256-fingerprint>
Print the 24 character Node Manager password itself when you need it (and store it in your secret manager):
sudo sed -n 's/^NODEMANAGER_PASSWORD=//p' /root/ohs-credentials.txt
You need the Node Manager password only for WLST (Step 6). Starting and stopping Oracle HTTP Server never asks for it: first boot stored the Node Manager credentials for the oracle user with Oracle's storeUserConfig (encrypted, in /home/oracle/.wlst), and ohs.service uses them.
The host name is the instance's public DNS name (or its public or private address when it has no public name). To serve your site on your own DNS name, see Step 8.
Step 5: Open your site over HTTPS
The certificate is self signed and generated on your instance. A public copy is at /etc/cloudimg/ohs-tls.crt. Check it, and compare its SHA-256 fingerprint with TLS_CERT_SHA256_FINGERPRINT above before you trust it in a browser:
openssl x509 -in /etc/cloudimg/ohs-tls.crt -noout -subject -enddate -ext subjectAltName
openssl x509 -in /etc/cloudimg/ohs-tls.crt -noout -fingerprint -sha256
subject=CN=<public-dns>
notAfter=<expiry date, 825 days after first boot>
X509v3 Subject Alternative Name:
DNS:<public-dns>, IP Address:<public-ip>, DNS:<private-dns>, IP Address:<private-ip>, DNS:localhost, IP Address:127.0.0.1
sha256 Fingerprint=<sha256-fingerprint>
From the instance, the welcome page answers over HTTPS with that certificate, and port 80 redirects to HTTPS. The configured host name is in /etc/cloudimg/ohs-host:
H=$(cat /etc/cloudimg/ohs-host)
curl -s -o /dev/null -w "%{http_code}\n" --cacert /etc/cloudimg/ohs-tls.crt --resolve "$H:443:127.0.0.1" "https://$H/"
curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" --resolve "$H:80:127.0.0.1" "http://$H/"
200
301 https://<public-dns>/
The certificate Oracle HTTP Server actually serves on port 443 is the same one, and the connection uses TLS 1.3:
H=$(cat /etc/cloudimg/ohs-host)
openssl s_client -connect 127.0.0.1:443 -servername "$H" </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256
openssl s_client -connect 127.0.0.1:443 -servername "$H" -brief </dev/null 2>&1 | grep -E '^(Protocol version|Ciphersuite)'
sha256 Fingerprint=<sha256-fingerprint>
Protocol version: TLSv1.3
Ciphersuite: <cipher suite>
From your workstation, copy the certificate and let curl verify it (or open the OHS_HTTPS_URL from Step 4 in your browser and accept the self signed certificate after checking its fingerprint):
scp -i <your-key.pem> ec2-user@<public-ip>:/etc/cloudimg/ohs-tls.crt .
curl -I --cacert ohs-tls.crt https://<public-dns>/
The instance carries a self test that proves the whole path in one go: HTTPS with the instance certificate, the HTTP to HTTPS redirect, a wrong Node Manager password refused, and this instance's Node Manager password accepted with ohs1 reported RUNNING:
sudo /usr/local/sbin/ohs-selftest
HTTPS https://<public-dns>/ 200 (instance certificate verified); HTTP 301 -> https://<public-dns>/
Node Manager (127.0.0.1:5556): wrong password refused; per-instance password accepted; ohs1 RUNNING
OHS_ROUNDTRIP_OK
Step 6: Check Oracle HTTP Server with WLST and Node Manager
The WebLogic Scripting Tool (WLST) runs as the oracle user and talks to Node Manager over SSL on the loopback address. This example hands the Node Manager password to WLST in a file readable only by oracle (never on a command line or in an environment variable), prints the state of ohs1, and removes the file:
PWF=$(sudo mktemp /run/ohs-nm-pw.XXXXXX)
sudo sed -n 's/^NODEMANAGER_PASSWORD=//p' /root/ohs-credentials.txt | sudo tee "$PWF" >/dev/null
sudo chown oracle:oinstall "$PWF"
cat > /tmp/ohs-nm-status.py <<'PY'
import os
f = open(os.environ['PWF']); pw = f.read().strip(); f.close()
nmConnect('nmadmin', pw, 'localhost', '5556', 'base_domain', '/u01/app/oracle/config/domains/base_domain', 'ssl')
pw = None
print('ohs1 state: ' + str(nmServerStatus(serverName='ohs1', serverType='OHS')))
nmDisconnect()
exit()
PY
chmod 0644 /tmp/ohs-nm-status.py
cd /u01 && sudo setpriv --reuid=oracle --regid=oinstall --init-groups env -i HOME=/home/oracle PWF="$PWF" \
JAVA_HOME=/usr/lib/jvm/jre-21-openjdk PATH=/usr/lib/jvm/jre-21-openjdk/bin:/usr/bin:/bin \
/u01/app/oracle/product/ohs/oracle_common/common/bin/wlst.sh /tmp/ohs-nm-status.py 2>&1 | grep -E 'Successfully Connected|ohs1 state'
sudo rm -f "$PWF" /tmp/ohs-nm-status.py
Successfully Connected to Node Manager.
ohs1 state: RUNNING
For an interactive session, start WLST as oracle and type the password from Step 4 at the prompt:
sudo -u oracle /u01/app/oracle/product/ohs/oracle_common/common/bin/wlst.sh
nmConnect(username='nmadmin', password='<password from /root/ohs-credentials.txt>', host='localhost', port='5556',
domainName='base_domain', domainDir='/u01/app/oracle/config/domains/base_domain', nmType='ssl')
nmServerStatus(serverName='ohs1', serverType='OHS')
nmDisconnect()
exit()
Use ohs.service (Step 9) rather than nmStart and nmKill to start and stop Oracle HTTP Server, so systemd always knows its state.
Step 7: Configure Oracle HTTP Server
Where the configuration lives
Edit the staging configuration of the ohs1 component:
/u01/app/oracle/config/domains/base_domain/config/fmwconfig/components/OHS/ohs1
Node Manager copies it to the runtime directory (.../components/OHS/instances/ohs1) every time ohs1 starts, so a change made only in the runtime directory is overwritten on the next start. After every change, restart Oracle HTTP Server with sudo systemctl restart ohs.service. The files you use most:
sudo ls /u01/app/oracle/config/domains/base_domain/config/fmwconfig/components/OHS/ohs1 | grep -E '^(httpd\.conf|ssl\.conf|admin\.conf|mod_wl_ohs\.conf|htdocs|moduleconf)$' | LC_ALL=C sort
admin.conf
htdocs
httpd.conf
mod_wl_ohs.conf
moduleconf
ssl.conf
| File | Purpose |
|---|---|
httpd.conf |
Main server configuration: Listen 80, ServerName, modules, DocumentRoot |
ssl.conf |
The HTTPS virtual host on port 443 (<VirtualHost *:443>) and its wallet |
admin.conf |
The admin port 127.0.0.1:9999 that Node Manager uses (keep it on the loopback address) |
mod_wl_ohs.conf |
The WebLogic Server proxy plug in |
htdocs/ |
Static content (the welcome page) |
moduleconf/ |
Extra *.conf files, included at the end of httpd.conf; cloudimg.conf holds the HTTP to HTTPS redirect |
The files are owned by oracle. Edit them as oracle with your editor, for example sudo -u oracle vi <file>, so ownership and SELinux labels stay as they are.
Check which of Oracle's modules httpd.conf and the other files load (a line starting with # is commented out):
sudo grep -rhE '^[[:space:]]*#?[[:space:]]*LoadModule[[:space:]]+(rewrite_module|proxy_module|proxy_http_module|weblogic_module|ossl_module|security2_module)' \
/u01/app/oracle/config/domains/base_domain/config/fmwconfig/components/OHS/ohs1
Serve static content
Put your files in htdocs/ of the staging directory as oracle, then restart so Node Manager copies them to the runtime directory:
STAGE=/u01/app/oracle/config/domains/base_domain/config/fmwconfig/components/OHS/ohs1
echo '<h1>Hello from Oracle HTTP Server</h1>' | sudo -u oracle tee "$STAGE/htdocs/hello.html" >/dev/null
sudo systemctl restart ohs.service
H=$(cat /etc/cloudimg/ohs-host)
curl -s --cacert /etc/cloudimg/ohs-tls.crt --resolve "$H:443:127.0.0.1" "https://$H/hello.html"
<h1>Hello from Oracle HTTP Server</h1>
Front WebLogic Server with mod_wl_ohs
The WebLogic proxy plug in (mod_wl_ohs) is configured in mod_wl_ohs.conf. Oracle's file ships with its directives commented out. To send everything under /app to a WebLogic Server (or cluster) that this instance can reach, set the backend and a Location (replace the host and port with your WebLogic Server's):
<IfModule weblogic_module>
WebLogicHost 10.0.1.20
WebLogicPort 7001
</IfModule>
<Location /app>
SetHandler weblogic-handler
</Location>
For a cluster, use WebLogicCluster 10.0.1.20:7001,10.0.1.21:7001 instead of WebLogicHost and WebLogicPort. To reach WebLogic over TLS, add SecureProxy ON and a WLSSLWallet that trusts the WebLogic certificate, as Oracle's documentation describes. Restart with sudo systemctl restart ohs.service; requests to https://<your host>/app/ are then served by WebLogic. Allow this instance's private address to reach the WebLogic port in the WebLogic security group.
Reverse proxy to another backend with mod_proxy
For a backend that is not WebLogic (Tomcat, Node.js, any HTTP service), use Apache's mod_proxy inside the HTTPS virtual host in ssl.conf (make sure proxy_module and proxy_http_module are loaded, see the check above):
<VirtualHost *:443>
...
ProxyPreserveHost On
ProxyPass /api/ http://10.0.1.30:8080/api/
ProxyPassReverse /api/ http://10.0.1.30:8080/api/
</VirtualHost>
Requests to the instance metadata service (169.254.169.254) are always refused from inside Oracle HTTP Server (Step 11), so a proxy rule can never expose the instance's credentials.
The HTTP to HTTPS redirect
The redirect from port 80 to HTTPS is in moduleconf/cloudimg.conf of the staging directory. It redirects to the configured ServerName (never to a host name a client sends), and it also turns off HTTP TRACE:
sudo cat /u01/app/oracle/config/domains/base_domain/config/fmwconfig/components/OHS/ohs1/moduleconf/cloudimg.conf
# cloudimg defaults for Oracle HTTP Server (edit or delete this file in
# $DOMAIN_HOME/config/fmwconfig/components/OHS/ohs1/moduleconf/ and run: sudo systemctl restart ohs.service)
#
# Port 80 answers with a permanent redirect to HTTPS on this server's ServerName (set at first boot to the instance's
# public DNS name, or by `sudo /usr/local/sbin/ohs-set-host <name>`). Remove the block to serve plain HTTP on port 80.
# (These rules sit in the main server, which answers port 80 only: the HTTPS and admin virtual hosts do not inherit
# them.)
UseCanonicalName On
<IfModule rewrite_module>
RewriteEngine on
RewriteRule ^/?(.*)$ https://%{SERVER_NAME}/$1 [R=301,L,NE]
</IfModule>
TraceEnable off
To serve plain HTTP on port 80 as well, remove the <IfModule rewrite_module> block (or the whole file) and restart ohs.service. HTTP TRACE stays off either way: Oracle's own httpd.conf also sets TraceEnable off.
Logs
| Log | Path |
|---|---|
| Server log | /u01/app/oracle/config/domains/base_domain/servers/ohs1/logs/ohs1.log |
| Access log | /u01/app/oracle/config/domains/base_domain/servers/ohs1/logs/access_log |
| Component start and stop (Node Manager) | /u01/app/oracle/config/domains/base_domain/system_components/OHS/ohs_nm.log |
| Node Manager | /u01/app/oracle/config/domains/base_domain/nodemanager/nodemanager.log |
| First boot | /var/log/ohs-firstboot.log |
The latest requests:
sudo tail -n 5 /u01/app/oracle/config/domains/base_domain/servers/ohs1/logs/access_log
Step 8: Your own DNS name and certificate
Point your DNS name at the instance, then run (replace the name):
sudo /usr/local/sbin/ohs-set-host ohs.example.com
This stops Oracle HTTP Server, generates a new self signed certificate for the name (and the instance's own names and addresses) in the wallet, sets it as ServerName and so as the redirect target, updates the URLs and the fingerprint in /root/ohs-credentials.txt and /etc/cloudimg/ohs-host, and starts Oracle HTTP Server again. It prints the new certificate's SHA-256 fingerprint.
A certificate from your certificate authority. Oracle HTTP Server reads its certificate from the auto login Oracle wallet in:
/u01/app/oracle/config/domains/base_domain/config/fmwconfig/components/OHS/instances/ohs1/keystores/default
Run sudo /usr/local/sbin/ohs-set-host <your name> first, so ServerName and the redirect use your name. Then put your private key, certificate and the CA chain into a PKCS#12 file, build a new wallet from it with Oracle's orapki as oracle, and swap it in (the names and paths in this example are yours to replace):
openssl pkcs12 -export -inkey ohs.example.com.key -in ohs.example.com.crt -certfile ca-chain.crt -out ohs.example.com.p12
sudo install -o oracle -g oinstall -m 0600 ohs.example.com.p12 /home/oracle/ohs.example.com.p12
W=/u01/app/oracle/config/domains/base_domain/config/fmwconfig/components/OHS/instances/ohs1/keystores/default
ORAPKI="sudo -u oracle env JAVA_HOME=/usr/lib/jvm/jre-21-openjdk /u01/app/oracle/product/ohs/bin/orapki"
sudo -u oracle mkdir -m 0750 "$W.new"
$ORAPKI wallet create -wallet "$W.new" -auto_login_only
$ORAPKI wallet import_pkcs12 -wallet "$W.new" -auto_login_only -pkcs12file /home/oracle/ohs.example.com.p12
(type the PKCS#12 password at the prompt)
$ORAPKI wallet display -wallet "$W.new"
sudo systemctl stop ohs.service
sudo mv "$W" "$W.selfsigned" && sudo mv "$W.new" "$W" && sudo restorecon -R "$W"
sudo systemctl start ohs.service
sudo shred -u /home/oracle/ohs.example.com.p12
orapki wallet display must list your certificate under "User Certificates" and your CA under "Trusted Certificates". Check the result from your workstation with curl -I https://ohs.example.com/. If Oracle HTTP Server does not start, move $W.selfsigned back and read ohs1.log. ohs-selftest verifies HTTPS against /etc/cloudimg/ohs-tls.crt, so copy your server certificate there as well (sudo install -m 0644 ohs.example.com.crt /etc/cloudimg/ohs-tls.crt); the fingerprint in /root/ohs-credentials.txt still names the self signed certificate. Running ohs-set-host again replaces your certificate with a new self signed one.
Step 9: Manage the Oracle HTTP Server services
Oracle HTTP Server and its Node Manager are ordinary systemd services:
systemctl status ohs-nodemanager.service ohs.service --no-pager --lines=0
sudo systemctl restart ohs.servicerestarts Oracle HTTP Server (and applies configuration changes);stopandstartwork as usual.sudo systemctl restart ohs-nodemanager.servicerestarts Node Manager;ohs.servicerestarts with it.- To stop everything (for example before patching):
sudo systemctl stop ohs-nodemanager.service(this stopsohs.servicefirst). To start again:sudo systemctl start ohs-nodemanager.service ohs.service.
Both start at boot. If an httpd process stops unexpectedly, Node Manager starts it again.
Step 10: Apply Oracle patches and Java updates
This image is built from Oracle's Oracle HTTP Server 14.1.2.0.0 base release. The only patches in the Oracle home are the two one off patches the installer applies itself; no Patch Set Update (PSU) or other Oracle patch is applied, because Oracle distributes Oracle HTTP Server patches through My Oracle Support to licensed customers. The release build and the patch inventory:
sudo grep '^APACHE_' /u01/app/oracle/product/ohs/ohs/bin/version.txt
sudo ls /u01/app/oracle/product/ohs/inventory/patches
APACHE_14.1.2.0.0_LINUX.X64_241119.0625
36964826.xml
36990807.xml
OPatch, as oracle, shows the same:
cd /u01 && sudo setpriv --reuid=oracle --regid=oinstall --init-groups env -i HOME=/home/oracle \
JAVA_HOME=/usr/lib/jvm/jre-21-openjdk PATH=/usr/lib/jvm/jre-21-openjdk/bin:/usr/bin:/bin \
/u01/app/oracle/product/ohs/OPatch/opatch lspatches -oh /u01/app/oracle/product/ohs
36990807;One-off
36964826;One-off
OPatch succeeded.
Apply the current Oracle HTTP Server PSU and security patches with your own Oracle support entitlement, following each patch's README, Oracle's patching documentation for Oracle Fusion Middleware 14.1.2 (Patching with OPatch) and the quarterly Oracle Critical Patch Update advisories. Stop Oracle HTTP Server and Node Manager first, apply the patch as oracle (whose login profile sets ORACLE_HOME, DOMAIN_HOME, JAVA_HOME and puts OPatch on the PATH), then start them again:
sudo systemctl stop ohs-nodemanager.service
sudo -iu oracle
cd /home/oracle/patches/<patch-number>
opatch apply
opatch lspatches
exit
sudo systemctl start ohs-nodemanager.service ohs.service
sudo /usr/local/sbin/ohs-selftest
Java updates come from Oracle Linux. The Oracle HTTP Server tools run on Oracle Linux's OpenJDK 21 through /usr/lib/jvm/jre-21-openjdk, which points at the installed java-21-openjdk-headless package, and oracle_common/jdk in the Oracle home is a link to the same path. dnf-automatic installs its security updates with the other Oracle Linux errata every day, or update by hand with sudo dnf -y update java-21-openjdk-headless. Nothing in the Oracle home or the domain names the versioned JDK directory, so no file changes; restart Node Manager so it runs on the new JDK (sudo systemctl restart ohs-nodemanager.service).
Check the Java runtime:
sudo readlink /u01/app/oracle/product/ohs/oracle_common/jdk
rpm -q java-21-openjdk-headless
readlink -f /usr/lib/jvm/jre-21-openjdk
/usr/lib/jvm/jre-21-openjdk
java-21-openjdk-headless-<version>.el9.x86_64
/usr/lib/jvm/java-21-openjdk-<version>.el9.x86_64
The version numbers move on as Oracle Linux publishes OpenJDK updates. Daily security updates are switched on in /etc/dnf/automatic.conf:
systemctl is-enabled dnf-automatic.timer
grep -E '^(upgrade_type|apply_updates)' /etc/dnf/automatic.conf
enabled
upgrade_type = security
apply_updates = yes
Running on Oracle JDK instead (Oracle support customers). If your Oracle support contract requires Oracle JDK, install it yourself under your own Oracle entitlement; cloudimg does not supply it:
- Sign in to Oracle with your account and download the Oracle JDK 21 RPM for Linux x64 (
jdk-21_linux-x64_bin.rpm) under the terms your Oracle licence gives you, then copy it to the instance. - Install it, find its directory and point the Oracle home's
oracle_common/jdklink at it:
text
sudo dnf -y install ./jdk-21_linux-x64_bin.rpm
ORACLE_JDK=$(dirname "$(dirname "$(rpm -ql jdk-21 | grep '/bin/java$' | head -1)")"); echo "${ORACLE_JDK}"
sudo -u oracle ln -sfn "${ORACLE_JDK}" /u01/app/oracle/product/ohs/oracle_common/jdk
- Point every other place that names the OpenJDK path at it (the systemd units, the domain, the Oracle home's install record, the
oracleuser's profile and the cloudimg tools), then restart:
text
sudo grep -rlF /usr/lib/jvm/jre-21-openjdk /etc/systemd/system/ohs-nodemanager.service /etc/systemd/system/ohs.service \
/u01/app/oracle/config/domains/base_domain /u01/app/oracle/product/ohs/oui/.globalEnv.properties \
/home/oracle/.bash_profile /usr/local/lib/cloudimg/ohs/common.sh | sudo xargs sed -i "s|/usr/lib/jvm/jre-21-openjdk|${ORACLE_JDK}|g"
sudo systemctl daemon-reload
sudo systemctl restart ohs-nodemanager.service
sudo /usr/local/sbin/ohs-selftest
From then on you update Oracle JDK under your Oracle entitlement. To go back, point the link at /usr/lib/jvm/jre-21-openjdk again and run the same sed with the two paths swapped.
Step 11: Check the security model
Only SSH, HTTP and HTTPS listen on the network; the Oracle HTTP Server admin port and Node Manager listen on the loopback address only:
sudo ss -tlnH | awk '{print $4}' | LC_ALL=C sort -u
*:443
*:80
0.0.0.0:22
127.0.0.1:9999
[::]:22
[::ffff:127.0.0.1]:5556
firewalld allows only SSH, HTTP and HTTPS (and the DHCPv6 client):
sudo firewall-cmd --list-services
dhcpv6-client http https ssh
SSH accepts key logins only: password and keyboard interactive logins, root logins and X11 forwarding are off. sshd -T shows the values sshd actually uses:
sudo sshd -T | grep -E '^(passwordauthentication|kbdinteractiveauthentication|permitrootlogin|x11forwarding|pubkeyauthentication) '
permitrootlogin no
pubkeyauthentication yes
passwordauthentication no
kbdinteractiveauthentication no
x11forwarding no
The httpd processes run as oracle, inside the Node Manager service:
ps -C httpd -o user=,unit= | awk '{print $1, $2}' | sort -u
oracle ohs-nodemanager.service
Every process of the two Oracle HTTP Server services (Node Manager, every httpd process it runs, and the WLST client ohs.service uses) is blocked from the instance metadata service, while the rest of the instance can still use it (first boot uses it to find the host name). On Oracle Linux 9 this is enforced by systemd: both units carry IPAddressDeny= for the metadata addresses, which the kernel applies to everything in the unit's control group whatever user it runs as:
sudo systemctl show -p IPAddressDeny ohs-nodemanager.service ohs.service
IPAddressDeny=169.254.169.254/32 fd00:ec2::254/128 168.63.129.16/32
IPAddressDeny=169.254.169.254/32 fd00:ec2::254/128 168.63.129.16/32
To see it, run a request from inside the Node Manager service's control group (where the httpd processes run) and one from your own session (000 means no answer):
CG=$(systemctl show -p ControlGroup --value ohs-nodemanager.service)
sudo bash -c "echo \$\$ > /sys/fs/cgroup$CG/cgroup.procs && exec curl -s -m 5 -o /dev/null -w 'inside ohs-nodemanager.service: %{http_code}\n' -X PUT -H 'X-aws-ec2-metadata-token-ttl-seconds: 60' http://169.254.169.254/latest/api/token"
sudo curl -s -m 5 -o /dev/null -w "outside the units: %{http_code}\n" -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 60" http://169.254.169.254/latest/api/token
inside ohs-nodemanager.service: 000
outside the units: 200
If something you run behind Oracle HTTP Server needs AWS credentials, give it its own credentials (for example AWS Secrets Manager) rather than the instance role. SELinux is enforcing:
getenforce
Enforcing
Server components
| Component | Version or detail |
|---|---|
| Oracle HTTP Server | 14.1.2.0.0, Standalone HTTP Server install type (Apache HTTP Server 2.4.62, OpenSSL 3.0.15) |
| Oracle modules | mod_wl_ohs (WebLogic proxy plug in), mod_ossl (TLS with Oracle wallets), mod_security2 |
| Java | Oracle Linux OpenJDK 21 (java-21-openjdk-headless) |
| Operating system | Oracle Linux 9 (x86_64), Unbreakable Enterprise Kernel |
| Domain | base_domain (standalone), component ohs1, per domain Node Manager |
| Port | Listens on | Purpose |
|---|---|---|
| 22 | all addresses | SSH (key only) |
| 80 | all addresses | HTTP, redirects to HTTPS |
| 443 | all addresses | HTTPS (TLS 1.2 and 1.3) |
| 9999 | 127.0.0.1 |
Oracle HTTP Server admin port (used by Node Manager) |
| 5556 | 127.0.0.1 |
Node Manager (SSL) |
Filesystem layout
| Path | Purpose |
|---|---|
/u01/app/oracle/product/ohs |
Oracle home (ORACLE_HOME) |
/u01/app/oracle/product/ohs/oracle_common/jdk |
Link to /usr/lib/jvm/jre-21-openjdk (no Oracle JDK on the image) |
/u01/app/oracle/config/domains/base_domain |
Your domain (DOMAIN_HOME), created on first boot |
$DOMAIN_HOME/config/fmwconfig/components/OHS/ohs1 |
Staging configuration of ohs1 (edit here) |
$DOMAIN_HOME/config/fmwconfig/components/OHS/instances/ohs1 |
Runtime configuration (copied from staging on every start) |
$DOMAIN_HOME/config/fmwconfig/components/OHS/instances/ohs1/keystores/default |
TLS wallet (auto login, cwallet.sso) |
$DOMAIN_HOME/servers/ohs1/logs |
ohs1.log and access_log |
/u01/app/oraInventory |
Oracle inventory |
/usr/lib/jvm/jre-21-openjdk |
Oracle Linux OpenJDK 21 (alternatives link to the installed java-21-openjdk-headless) |
/root/ohs-credentials.txt |
This instance's Node Manager credentials and URLs (root only) |
/etc/cloudimg/ohs-tls.crt |
Public copy of this instance's TLS certificate |
/etc/cloudimg/ohs-host |
The configured host name |
/usr/local/sbin/ohs-set-host, ohs-selftest |
Change the host name and certificate; prove the HTTPS and Node Manager path |
/var/log/ohs-firstboot.log |
First boot log |
/usr/share/doc/cloudimg/licenses/ |
Oracle and Java notices |
The oracle user's ~/.bash_profile exports JAVA_HOME, ORACLE_HOME and DOMAIN_HOME and puts WLST, orapki and OPatch on the PATH.
Troubleshooting
Oracle HTTP Server does not start. Check both units, then the component and server logs:
sudo journalctl -u ohs-nodemanager.service -u ohs.service -n 30 --no-pager
sudo tail -n 20 /u01/app/oracle/config/domains/base_domain/system_components/OHS/ohs_nm.log
sudo tail -n 20 /u01/app/oracle/config/domains/base_domain/servers/ohs1/logs/ohs1.log
A configuration error in a file you edited shows in ohs1.log; fix it in the staging directory and restart ohs.service.
ohs first boot has not finished. ohs-nodemanager.service and ohs.service only start after first boot has created /var/lib/cloudimg/ohs-firstboot.done, the domain, the wallet and the credentials file. If the marker is missing, read /var/log/ohs-firstboot.log.
Port 443 refuses the connection. First boot or Oracle HTTP Server is still starting (one to two minutes after launch); wait a minute and try again.
No answer at all on 443 from your workstation. Check that the security group allows your address on 443 and 80.
A browser warns about the certificate. The first boot certificate is self signed; compare its fingerprint (Step 5), or install a certificate from your certificate authority (Step 8).
Security recommendations
- Allow 80 and 443 only from the networks that use your site, and 22 only from your administration networks. Never open 9999 or 5556.
- Replace the self signed certificate with one from your certificate authority for production (Step 8).
- Keep the admin port in
admin.confand Node Manager on the loopback address. - Keep SSH key only, and keep the Node Manager password in your secret manager.
- Apply Oracle's Oracle HTTP Server PSUs and Critical Patch Updates with your Oracle support entitlement (Step 10).
Support
For help with this image, contact cloudimg support:
- Support:
support@cloudimg.co.ukor www.cloudimg.co.uk/support, on hand 24 hours a day by email, with a guaranteed response within 24 hours - Website: www.cloudimg.co.uk
- User Guides: www.cloudimg.co.uk/guides
Oracle HTTP Server documentation is at docs.oracle.com. Oracle software support, Oracle patches and Oracle licences come from Oracle under your own agreement.
Licensing and price
This image is bring your own licence: using Oracle HTTP Server requires your own Oracle licence, and Oracle patches (PSUs and Critical Patch Updates) come from Oracle under your own agreement, as Step 10 describes. The Java runtime is Oracle Linux's OpenJDK 21 (GPLv2 with the Classpath Exception); no Oracle JDK is included. The cloudimg software charge of $0.04 per vCPU per hour (plus AWS infrastructure charges) is for what cloudimg adds to the image: the standalone domain created on each instance at first boot with its own Node Manager password, the per-instance TLS certificate, the admin port and Node Manager on the loopback address only, SSH by key pair only, and the Oracle HTTP Server processes blocked from the instance metadata service. Your Oracle licence is not part of this charge; you obtain it from Oracle.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. cloudimg is not affiliated with or endorsed by Oracle.