From 348568c89ae1ad19270e930c02a1492bc43e99b1 Mon Sep 17 00:00:00 2001 From: startxfr Date: Sat, 28 Nov 2015 19:46:13 +0100 Subject: Adding display of OS flavour at startup and improving flexibility of services with env param --- Services/apache/sx-httpd.sh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'Services/apache/sx-httpd.sh') diff --git a/Services/apache/sx-httpd.sh b/Services/apache/sx-httpd.sh index 6b2a417..363e74f 100644 --- a/Services/apache/sx-httpd.sh +++ b/Services/apache/sx-httpd.sh @@ -7,17 +7,24 @@ function check_httpd_environment { echo "! WARNING : environment var SERVER_NAME is missing..." echo "! WARNING : auto-assigned value : $SERVER_NAME" fi - if [ ! -v DOCROOT ]; then - DOCROOT="/data/www" - export DOCROOT - echo "! WARNING : environment var DOCROOT is missing..." - echo "! WARNING : auto-assigned value : $DOCROOT" + if [ ! -v DOC_ROOT ]; then + DOC_ROOT="/data/httpd" + export DOC_ROOT + fi + if [ ! -v APP_PATH ]; then + APP_PATH="/data/httpd" + export APP_PATH + fi + if [ ! -v LOG_PATH ]; then + LOG_PATH="/data/logs/httpd" + export LOG_PATH fi } function display_container_httpd_header { echo "+=====================================================" echo "| Container : $HOSTNAME" + echo "| OS : $( BEGIN APACHE CONFIGURATION" - mkdir -p /var/run/httpd - if [ -v DOCROOT ]; then - echo "=> Set DocumentRoot to $DOCROOT in $HTTPDCONF" - echo "DocumentRoot \"$DOCROOT\"" >> $HTTPDCONF - fi - if [ -v SERVER_NAME ]; then - echo "=> Set ServerName to $SERVER_NAME in $HTTPDCONF" - echo "ServerName \"$SERVER_NAME\"" >> $HTTPDCONF - fi } # End configuration process just before starting daemon function end_config { - stop_server echo "=> END APACHE CONFIGURATION" } @@ -74,5 +77,6 @@ function stop_server { # the running shell function start_daemon { echo "=> Starting httpd daemon ..." + display_container_started exec /usr/sbin/apachectl -D FOREGROUND } -- cgit v1.2.3