diff options
author | startxfr <clarue@startx.fr> | 2015-11-28 19:46:13 +0100 |
---|---|---|
committer | startxfr <clarue@startx.fr> | 2015-11-28 19:46:13 +0100 |
commit | 348568c89ae1ad19270e930c02a1492bc43e99b1 (patch) | |
tree | 97514774d5c27789d9383f5085103eb9775b6a52 /Services/apache/sx-httpd.sh | |
parent | 05c9aa4a4d3572168878bf0e81eeac724a95454d (diff) | |
download | phpmyadmin-348568c89ae1ad19270e930c02a1492bc43e99b1.tar.gz phpmyadmin-348568c89ae1ad19270e930c02a1492bc43e99b1.tar.bz2 phpmyadmin-348568c89ae1ad19270e930c02a1492bc43e99b1.tar.xz phpmyadmin-348568c89ae1ad19270e930c02a1492bc43e99b1.zip |
Adding display of OS flavour at startup and improving flexibility of services with env param
Diffstat (limited to 'Services/apache/sx-httpd.sh')
-rw-r--r-- | Services/apache/sx-httpd.sh | 34 |
1 files changed, 19 insertions, 15 deletions
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 : $(</etc/redhat-release)" if [ -v CONTAINER_TYPE ]; then echo "| Type : $CONTAINER_TYPE" fi @@ -30,6 +37,12 @@ function display_container_httpd_header { if [ -v CONTAINER_SERVICE ]; then echo "| ServerName : $SERVER_NAME" fi + if [ -v APP_PATH ]; then + echo "| App path : $APP_PATH" + fi + if [ -v LOG_PATH ]; then + echo "| Log path : $LOG_PATH" + fi echo "+=====================================================" } @@ -37,20 +50,10 @@ function display_container_httpd_header { # and start generating host keys function begin_config { echo "=> 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 } |