summaryrefslogtreecommitdiffstats
path: root/Services/apache/sx-httpd.sh
diff options
context:
space:
mode:
authorstartxfr <clarue@startx.fr>2015-11-28 16:00:38 +0100
committerstartxfr <clarue@startx.fr>2015-11-28 16:00:38 +0100
commit05c9aa4a4d3572168878bf0e81eeac724a95454d (patch)
tree3cc6d3145ab8a131c2da29aaa2f7438ca23ad0df /Services/apache/sx-httpd.sh
parent4bb17b8c05c6e430293217797eef694671ec1e1b (diff)
downloadphpmyadmin-05c9aa4a4d3572168878bf0e81eeac724a95454d.tar.gz
phpmyadmin-05c9aa4a4d3572168878bf0e81eeac724a95454d.tar.bz2
phpmyadmin-05c9aa4a4d3572168878bf0e81eeac724a95454d.tar.xz
phpmyadmin-05c9aa4a4d3572168878bf0e81eeac724a95454d.zip
change in apache script for handling ServerName
Diffstat (limited to 'Services/apache/sx-httpd.sh')
-rw-r--r--Services/apache/sx-httpd.sh36
1 files changed, 33 insertions, 3 deletions
diff --git a/Services/apache/sx-httpd.sh b/Services/apache/sx-httpd.sh
index ad7b995..6b2a417 100644
--- a/Services/apache/sx-httpd.sh
+++ b/Services/apache/sx-httpd.sh
@@ -2,8 +2,35 @@
function check_httpd_environment {
if [ ! -v SERVER_NAME ]; then
- export SERVER_NAME=$CONTAINER_NAME
+ SERVER_NAME="localhost"
+ export SERVER_NAME
+ 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"
+ fi
+}
+
+function display_container_httpd_header {
+ echo "+====================================================="
+ echo "| Container : $HOSTNAME"
+ if [ -v CONTAINER_TYPE ]; then
+ echo "| Type : $CONTAINER_TYPE"
+ fi
+ if [ -v CONTAINER_INSTANCE ]; then
+ echo "| Instance : $CONTAINER_INSTANCE"
+ fi
+ if [ -v CONTAINER_SERVICE ]; then
+ echo "| Service : $CONTAINER_SERVICE"
+ fi
+ if [ -v CONTAINER_SERVICE ]; then
+ echo "| ServerName : $SERVER_NAME"
+ fi
+ echo "+====================================================="
}
# Begin configuration before starting daemonized process
@@ -12,10 +39,13 @@ function begin_config {
echo "=> BEGIN APACHE CONFIGURATION"
mkdir -p /var/run/httpd
if [ -v DOCROOT ]; then
- echo "=> Changing document root to $DOCROOT"
- ${DOCROOT=/data/www}
+ 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