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:
  1. Edit the required files in the $MYOHSFILES/ohsConfig subdirectories.
  2. Delete the ConfigMaps for any files you have changed. For example if you have changed httpd.conf and files in moduleconf, run:
    kubectl delete cm ohs-httpd -n ohsns
    kubectl delete cm ohs-config -n ohsns
  3. 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
  4. Find the name of the existing OHS pod:
    kubectl get pods -n <namespace>
    For example:
    kubectl get pods -n ohsns
    The output will look similar to the following:
    NAME                         READY   STATUS    RESTARTS   AGE
    ohs-domain-d5b648bc5-vkp4s   1/1     Running   0          55s
  5. Delete the pod using the following command:
    kubectl delete pod <pod> -n <namespace>
    For example:
    kubectl delete pod ohs-domain-d5b648bc5-vkp4s -n ohsns
    The output will look similar to the following:
    pod "ohs-domain-d5b648bc5-vkp4s" deleted
  6. Run the following command to make sure the pod has restarted:
    kubectl get pods -n ohsns
    The output will look similar to the following:
    NAME                         READY   STATUS    RESTARTS   AGE
    ohs-domain-d5b648bc5-gdvnp   1/1     Running   0          39s

7.2 Editing the ConfigMap

To edit the ConfigMap:
  1. Run the following command to edit the OHS configuration:
    kubectl edit configmap <configmap> -n <namespace>
    Where <configmap> is either ohs-httpd or ohs-config to modify the httpd.conf and moduleconf 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.
  2. In the edit session, edit the required parameters accordingly. Save the file and exit (:wq!).
  3. Find the name of the existing OHS pod:
    kubectl get pods -n <namespace>
    The output will look similar to the following:
    NAME                         READY   STATUS    RESTARTS   AGE
    ohs-domain-d5b648bc5-vkp4s   1/1     Running   0          2h33s
  4. Delete the pod using the following command:
    kubectl delete pod <pod> -n <namespace>
    For example:
    kubectl delete pod ohs-domain-d5b648bc5-vkp4s -n ohsns
    The output will look similar to the following:
    pod "ohs-domain-d5b648bc5-vkp4s" deleted
  5. Run the following command to make sure the pod has restarted:
    kubectl get pods -n ohsns -w
    The output will look similar to the following:
    NAME                         READY   STATUS    RESTARTS   AGE
    ohs-domain-d5b648bc5-gdvnp   1/1     Running   0          39s