From: Wolfram Schneider Date: Wed, 15 Oct 2014 11:00:50 +0000 (+0200) Subject: put port number in config/log filenames X-Git-Tag: 1.0.0~202 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=71a3bc5e72fdcf2a51c3d32f10b8248c0ac5399c put port number in config/log filenames This allow to us to run 2 apache servers at the same time, e.g. one for local development and one for local tests. --- diff --git a/test/Makefile b/test/Makefile index d4597df..86fca10 100644 --- a/test/Makefile +++ b/test/Makefile @@ -18,6 +18,7 @@ SCREENSHOT_WIDTH= 360 480 640 768 1024 1200 1440 2048 PERL_SCRIPTS= bin/bomb.pl TMP_DIR= ./logs APACHE_HTTPD:= $(shell env PATH=$$PATH:/usr/sbin which apache2 httpd false | head -1 ) +APACHE_PORT ?= 4040 all: check @@ -27,7 +28,7 @@ clean: distclean: clean clean-tmp clean-error rm -rf node_modules - rm -f ${TMP_DIR}/jasmine-dev + rm -f ${TMP_DIR}/jasmine-dev*.conf rm -f libexec make -C./widgets $@ @@ -99,16 +100,17 @@ node_modules node-modules: apache-start: bin/apache-template-update - ${APACHE_HTTPD} -f `pwd`/${TMP_DIR}/jasmine-dev + ${APACHE_HTTPD} -f `pwd`/${TMP_DIR}/jasmine-dev-${APACHE_PORT}.conf +APACHE_PID_FILE=${TMP_DIR}/mkws-jasmine-${APACHE_PORT}.pid apache-stop: - @-if [ -e ${TMP_DIR}/mkws-jasmine.pid ]; then \ - kill `cat ${TMP_DIR}/mkws-jasmine.pid`; \ + @-if [ -e ${APACHE_PID_FILE} ]; then \ + kill `cat ${APACHE_PID_FILE}`; \ else \ killall apache2 2> /dev/null; \ fi @sleep 0.6 - rm -f ${TMP_DIR}/mkws-jasmine.pid + rm -f ${APACHE_PID_FILE} help: @echo "make [ all | check | clean | distclean ]" diff --git a/test/bin/apache-template-update b/test/bin/apache-template-update index 29024ab..db0c6e5 100755 --- a/test/bin/apache-template-update +++ b/test/bin/apache-template-update @@ -9,11 +9,12 @@ export APACHE_SERVER_ROOT=$(pwd) export APACHE_RUN_USER=$(whoami) export APACHE_RUN_GROUP=$(groups | awk '{ print $1 }') -export APACHE_LOG_DIR=$APACHE_SERVER_ROOT/logs -export APACHE_PID_FILE=$APACHE_LOG_DIR/mkws-jasmine.pid -export APACHE_LOCK_FILE=$APACHE_LOG_DIR/accept.lock : ${APACHE_PORT=4040}; export APACHE_PORT +export APACHE_LOG_DIR=$APACHE_SERVER_ROOT/logs +export APACHE_PID_FILE=$APACHE_LOG_DIR/mkws-jasmine-${APACHE_PORT}.pid +export APACHE_LOCK_FILE=$APACHE_LOG_DIR/accept-${APACHE_PORT}.lock + export MKWS_ROOT=$(pwd)/.. MKWS_OS=debian @@ -47,7 +48,7 @@ else APACHE_MODULES="$MKWS_ROOT/tools/apache2/jasmine-dev.apache-modules.$MKWS_OS.conf" fi -: ${MKWS_APACHE_FILE="$APACHE_LOG_DIR/jasmine-dev"} +: ${MKWS_APACHE_FILE="$APACHE_LOG_DIR/jasmine-dev-${APACHE_PORT}.conf"} export APACHE_MODULES perl -npe 's,\${(.*?)},$ENV{$1},g; ' $MKWS_APACHE_TEMPLATE > $MKWS_APACHE_FILE.tmp diff --git a/tools/apache2/jasmine-dev.template b/tools/apache2/jasmine-dev.template index 92e22cb..6d73893 100644 --- a/tools/apache2/jasmine-dev.template +++ b/tools/apache2/jasmine-dev.template @@ -27,12 +27,12 @@ Include ${APACHE_MODULES} ServerAlias mkws-dev a.mkws.indexdata.com a.mkws-dev.indexdata.com mkws-dev.indexdata.com 127.0.0.1 ServerAdmin webmaster@indexdata.com - ErrorLog ${APACHE_LOG_DIR}/mkws-jasmine-error.log - CustomLog ${APACHE_LOG_DIR}/mkws-jasmine-access.log combined + ErrorLog ${APACHE_LOG_DIR}/mkws-jasmine-${APACHE_PORT}-error.log + CustomLog ${APACHE_LOG_DIR}/mkws-jasmine-${APACHE_PORT}-access.log combined RewriteEngine on RewriteLogLevel 1 - RewriteLog ${APACHE_LOG_DIR}/mkws-jasmine-rewrite.log + RewriteLog ${APACHE_LOG_DIR}/mkws-jasmine-rewrite-${APACHE_PORT}.log DocumentRoot ${MKWS_ROOT}/examples/htdocs Alias /tools/htdocs ${MKWS_ROOT}/tools/htdocs diff --git a/tools/apache2/jasmine-dev.template-2.4 b/tools/apache2/jasmine-dev.template-2.4 index 3c0f626..5adc4ba 100644 --- a/tools/apache2/jasmine-dev.template-2.4 +++ b/tools/apache2/jasmine-dev.template-2.4 @@ -24,8 +24,8 @@ Include ${APACHE_MODULES} ServerAlias mkws-dev a.mkws.indexdata.com a.mkws-dev.indexdata.com mkws-dev.indexdata.com 127.0.0.1 ServerAdmin webmaster@indexdata.com - ErrorLog ${APACHE_LOG_DIR}/mkws-jasmine-error.log - CustomLog ${APACHE_LOG_DIR}/mkws-jasmine-access.log combined + ErrorLog ${APACHE_LOG_DIR}/mkws-jasmine-error-${APACHE_PORT}.log + CustomLog ${APACHE_LOG_DIR}/mkws-jasmine-access-${APACHE_PORT}.log combined LogLevel info rewrite:debug RewriteEngine on