Author: jfrederic.clere(a)jboss.com
Date: 2008-09-30 08:23:10 -0400 (Tue, 30 Sep 2008)
New Revision: 1920
Modified:
trunk/mod_cluster/test/java/installhttpd.sh
Log:
Add parameters.
Modified: trunk/mod_cluster/test/java/installhttpd.sh
===================================================================
--- trunk/mod_cluster/test/java/installhttpd.sh 2008-09-30 12:22:24 UTC (rev 1919)
+++ trunk/mod_cluster/test/java/installhttpd.sh 2008-09-30 12:23:10 UTC (rev 1920)
@@ -1,6 +1,27 @@
#!/bin/sh
#
# Script to install httpd in $HOME and configure it for mod_cluster tests.
+# $1: IP address to listen (both for normal requests and cluster management ones.
+# $2: IP address for the advertise
+# $3: sub network to accept cluster management requests.
+IP=localhost
+ADVIP=232.0.0.2
+SUBIP=all
+if [ "x$1" != "x" ]
+then
+ IP=$1
+fi
+if [ "x$2" != "x" ]
+then
+ ADVIP=$2
+fi
+if [ "x$3" != "x" ]
+then
+ SUBIP=$3
+fi
+
+HOME=`pwd`
+export HOME
files="opt/jboss/httpd/sbin/apachectl opt/jboss/httpd/httpd/conf/httpd.conf
/opt/jboss/httpd/sbin/envvars"
for FILE in `echo $files`
do
@@ -22,24 +43,32 @@
# Arrange httpd.conf
file=$HOME/opt/jboss/httpd/httpd/conf/httpd.conf
cp -p $file $file.new
-echo "s:Listen 80:Listen 8000:" > sed.cmd
+echo "s/Listen 80/Listen @IP@:8000/" > sed.cmd
sed -f sed.cmd $file > $file.new
cat >> $file.new <<EOF
<IfModule manager_module>
- Listen file:6666
+ Listen @IP@:6666
ManagerBalancerName mycluster
- <VirtualHost file:6666>
+ <VirtualHost @IP@:6666>
<Directory />
Order deny,allow
Deny from all
- allow from 10.33.144
+ Allow from @SUBIP@
</Directory>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
+ ServerAdvertise on http://@IP@:6666
AdvertiseFrequency 5
+ AdvertiseGroup @ADVIP@:23364
</VirtualHost>
</IfModule>
EOF
+echo "s/@IP@/${IP}/" > sed.cmd
+echo "s/@ADVIP@/${ADVIP}/" >> sed.cmd
+echo "s/@SUBIP@/${SUBIP}/" >> sed.cmd
+sed -f sed.cmd $file.new > $file.new.1
+
+# replace httpd.conf by the new file.
mv $file $file.`date +%y%m%d.%H%M%S`.1.org
-mv $file.new $file
+mv $file.new.1 $file
Show replies by date