diff --git a/OracleLinuxDevelopers/oraclelinux10/httpd/2.4/entrypoint.sh b/OracleLinuxDevelopers/oraclelinux10/httpd/2.4/entrypoint.sh new file mode 100755 index 000000000..4a730c96d --- /dev/null +++ b/OracleLinuxDevelopers/oraclelinux10/httpd/2.4/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -eu pipefail + +SERVER_CERT="$CERTIFICATE_DIR/fullchain.pem" +SERVER_KEY="$KEY_DIR/privkey.pem" + +if [ ! -f "$SERVER_KEY" ]; then + echo "Generating certificate private key for SSL support" 1>&2 + openssl genpkey -algorithm RSA -out "$SERVER_KEY" 1>&2 +fi + +if [ ! -f "$SERVER_CERT" ]; then + echo "Generating self-signed certificate for SSL support" 1>&2 + openssl req -x509 -new -nodes -key "$SERVER_KEY" -sha256 -days 3650 -out "$SERVER_CERT" -subj "/C=US/ST=California/L=San Francisco/O=Test Company/CN=localhost" 1>&2 +fi + +httpd -DFOREGROUND \ No newline at end of file