Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions etc/apache-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ get_password ()
echo $(head -n 4096 /dev/urandom | tr -cd '[:alnum:]' | head -c ${1})
}

set_apache_server_name ()
{
local HOST_NAME=${1:-${APACHE_SERVER_NAME:-$(hostname)}}
local PORT=${2:-80}

sed -i \
-e "s~^#ServerName \(.*\):80$~ServerName ${HOST_NAME}:${PORT}~g" \
/etc/httpd/conf/httpd.conf
}

APP_HOME_DIR_TEMPLATE="/var/www/.app-skel"

OPTS_APACHE_SERVER_NAME="${APACHE_SERVER_NAME:-$(hostname)}"
Expand Down Expand Up @@ -58,6 +68,9 @@ else
exit 1
fi

# Add ServerName
set_apache_server_name ${OPTS_APACHE_SERVER_NAME} 80

# If users need to change the vhost.conf the SSL version can be rebuilt if it is deleted
if [[ ${OPTS_APACHE_MOD_SSL_ENABLED} == true ]] && [[ ! -f ${OPTS_APP_HOME_DIR}/vhost-ssl.conf ]] && [[ -f ${OPTS_APP_HOME_DIR}/vhost.conf ]]; then
echo "Rebuilding the SSL VirtualHost configuration."
Expand Down