7 Modifying the OHS Container
Learn how to modify the Oracle HTTP Server (OHS) configuration after the OHS container is deployed.
Modifying the deployed OHS container configuration can be achieved in one of the
following ways:
7.1 Edting Files in $MYOHFILES/ohsconfig
To edit the configuration files in
$MYOHFILES/ohsconfig
:
- Edit the required files in the
$MYOHSFILES/ohsConfig
subdirectories. - Delete the ConfigMaps for any files you have
changed. For example if you have changed
httpd.conf
and files inmoduleconf
, run:kubectl delete cm ohs-httpd -n ohsns kubectl delete cm ohs-config -n ohsns
- Recreate the required
ConfigMaps:
cd $MYOHSFILES kubectl create cm -n ohsns ohs-httpd --from-file=ohsConfig/httpconf kubectl create cm -n ohsns ohs-config --from-file=ohsConfig/moduleconf
- Find the name of the existing OHS
pod:
For example:kubectl get pods -n <namespace>
The output will look similar to the following:kubectl get pods -n ohsns
NAME READY STATUS RESTARTS AGE ohs-domain-d5b648bc5-vkp4s 1/1 Running 0 55s
- Delete the pod using the following
command:
For example:kubectl delete pod <pod> -n <namespace>
The output will look similar to the following:kubectl delete pod ohs-domain-d5b648bc5-vkp4s -n ohsns
pod "ohs-domain-d5b648bc5-vkp4s" deleted
- Run the following command to make sure the pod has
restarted:
The output will look similar to the following:kubectl get pods -n ohsns
NAME READY STATUS RESTARTS AGE ohs-domain-d5b648bc5-gdvnp 1/1 Running 0 39s
7.2 Editing the ConfigMap
To edit the ConfigMap:
- Run the following command to edit the OHS
configuration:
Wherekubectl edit configmap <configmap> -n <namespace>
<configmap>
is eitherohs-httpd
orohs-config
to modify thehttpd.conf
andmoduleconf
files respectively.For example:kubectl edit configmap ohs-httpd -n ohsns
Note:
This opens an edit session for the ConfigMap where parameters can be changed using standard vi commands. - In the edit session, edit the required parameters
accordingly. Save the file and exit
(
:wq!
). - Find the name of the existing OHS
pod:
The output will look similar to the following:kubectl get pods -n <namespace>
NAME READY STATUS RESTARTS AGE ohs-domain-d5b648bc5-vkp4s 1/1 Running 0 2h33s
- Delete the pod using the following
command:
For example:kubectl delete pod <pod> -n <namespace>
The output will look similar to the following:kubectl delete pod ohs-domain-d5b648bc5-vkp4s -n ohsns
pod "ohs-domain-d5b648bc5-vkp4s" deleted
- Run the following command to make sure the pod has
restarted:
The output will look similar to the following:kubectl get pods -n ohsns -w
NAME READY STATUS RESTARTS AGE ohs-domain-d5b648bc5-gdvnp 1/1 Running 0 39s