Author: jfrederic.clere(a)jboss.com
Date: 2008-12-17 05:50:37 -0500 (Wed, 17 Dec 2008)
New Revision: 2155
Added:
trunk/httpd/httpd-2.2/installer/installconf.sh
Modified:
trunk/build/unix/buildbin.rhel-httpd.sh
trunk/httpd/httpd-2.2/installer/installconf.awk
Log:
Arrange installer add unix and mod_cluster parameters.
Modified: trunk/build/unix/buildbin.rhel-httpd.sh
===================================================================
--- trunk/build/unix/buildbin.rhel-httpd.sh 2008-12-16 21:00:32 UTC (rev 2154)
+++ trunk/build/unix/buildbin.rhel-httpd.sh 2008-12-17 10:50:37 UTC (rev 2155)
@@ -218,6 +218,86 @@
mv $file $nfile
done
fi
+# Modify the conf files to allow installconf.awk to process them
+conffiles="opt/jboss/httpd/httpd/conf/httpd.conf
opt/jboss/httpd/httpd/conf/extra/httpd-dav.conf \
+ opt/jboss/httpd/httpd/conf/extra/httpd-ssl.conf
opt/jboss/httpd/httpd/conf/extra/httpd-vhosts.conf"
+apacheclt="opt/jboss/httpd/sbin/apachectl"
+envvars="opt/jboss/httpd/sbin/envvars"
+files="$conffiles $apacheclt $envvars"
+#
+# Arrange httpd.conf
+file="$RPM_BUILD_ROOT/jboss/httpd/httpd/conf/httpd.conf"
+cp -p $file $file.new
+echo 's:ServerRoot "/opt/jboss/httpd/httpd":ServerRoot
"@@ServerRoot@@":' > sed.cmd
+echo "s/Listen 80/Listen @@Port@@/" >> sed.cmd
+echo "s/LoadModule proxy_balancer/#LoadModule proxy_balancer/" >>
sed.cmd
+echo 's:DocumentRoot "/opt/jboss/httpd/htdocs/htdocs":DocumentRoot
"@exp_htdocsdir@":' >> sed.cmd
+echo 's:Directory "/opt/jboss/httpd/htdocs/htdocs":Directory
"@exp_htdocsdir@":' >> sed.cmd
+echo 's:ErrorLog "logs/error_log":ErrorLog
"@rel_logfiledir@/error_log":' >> sed.cmd
+echo 's:CustomLog "logs/access_log":CustomLog
"@rel_logfiledir@/access_log":' >> sed.cmd
+echo 's:Directory "/opt/jboss/httpd/htdocs/cgi-bin":Directory
"@exp_cgidir@":' >> sed.cmd
+echo "s:TypesConfig conf/mime.types:TypesConfig @rel_sysconfdir@/mime.types:"
>> sed.cmd
+sed -f sed.cmd $file > $file.new
+cat >> $file.new <<EOF
+<IfModule manager_module>
+ Listen @@MCMPIP@@:@@MCMPPORT@@
+ ManagerBalancerName mycluster
+ <VirtualHost @@MCMPIP@@:@@MCMPPORT@@>
+ <Directory />
+ Order deny,allow
+ Deny from all
+ Allow from @@SUBIP@@
+ </Directory>
+ KeepAliveTimeout 300
+ MaxKeepAliveRequests 0
+ ServerAdvertise on http://@@MCMPIP@@:@@MCMPPORT@@
+ AdvertiseFrequency 5
+ AdvertiseGroup @@ADVIP@@:23364
+ </VirtualHost>
+</IfModule>
+EOF
+mv $file.new $file
+#
+# Arrange conf/extra/httpd-dav.conf (if it exists)
+file="$RPM_BUILD_ROOT/jboss/httpd/httpd/extra/httpd-dav.conf"
+if [ -f $file ]; then
+ cp -p $file $file.new
+ echo "s:/opt/jboss/httpd/httpd:@@ServerRoot@@:" > sed.cmd
+ sed -f sed.cmd $file > $file.new
+ mv $file.new $file
+fi
+#
+# Arrange conf/extra/httpd-vhosts.conf (no that is just an example)
+file="$RPM_BUILD_ROOT/jboss/httpd/httpd/extra/httpd-vhosts.conf"
+#
+# Arrange conf/extra/httpd-ssl.conf (if it exists)
+file="$RPM_BUILD_ROOT/jboss/httpd/httpd/conf/extra/httpd-ssl.conf
+if [ -f $file ]; then
+ cp -p $file $file.new
+ echo "s/Listen 443/Listen @@SSLPort@@/" > sed.cmd
+ echo "s:/opt/jboss/httpd/httpd/logs/ssl_scache:@exp_runtimedir@/ssl_scache:"
>> sed.cmd
+ echo "s:/opt/jboss/httpd/httpd/logs/ssl_mutex:@exp_runtimedir@/ssl_mutex:"
>> sed.cmd
+ echo "s/_default_:443/_default_:@@SSLPort@@/" >> sed.cmd
+ echo 's:DocumentRoot "/opt/jboss/httpd/htdocs/htdocs":DocumentRoot
"@exp_htdocsdir@":' >> sed.cmd
+ echo "s/ServerName
www.example.com:443/ServerName
www.example.com:@@SSLPort@@/" >> sed.cmd
+ echo 's:ErrorLog "/opt/jboss/httpd/httpd/logs/error_log":ErrorLog
"@exp_logfiledir@/error_log":' >> sed.cmd
+ echo 's:TransferLog "/opt/jboss/httpd/httpd/logs/access_log":TransferLog
"@exp_logfiledir@/access_log":' >> sed.cmd
+ echo 's:SSLCertificateFile
"/opt/jboss/httpd/httpd/conf/server.crt":SSLCertificateFile
"@exp_sysconfdir@/server.crt":' >> sed.cmd
+ echo 's:SSLCertificateKeyFile
"/opt/jboss/httpd/httpd/conf/server.key":SSLCertificateKeyFile
"@exp_sysconfdir@/server.key":' >> sed.cmd
+ sed -f sed.cmd $file > $file.new
+ mv $file.new $file
+fi
+#
+# Arrange common parts
+for FILE in $files
+do
+ file=${RPM_BUILD_ROOT}/$FILE
+ echo "$file"
+ cp $file $file.in
+ sed "s:opt/jboss/httpd:@@HTTPDLOC@@:" $file > $file.in
+ rm -f $file
+done
+
echo "Done"
exit 0
Modified: trunk/httpd/httpd-2.2/installer/installconf.awk
===================================================================
--- trunk/httpd/httpd-2.2/installer/installconf.awk 2008-12-16 21:00:32 UTC (rev 2154)
+++ trunk/httpd/httpd-2.2/installer/installconf.awk 2008-12-17 10:50:37 UTC (rev 2155)
@@ -18,7 +18,17 @@
serverport = ARGV[4];
serversslport = ARGV[5];
serverroot = ARGV[6];
+ mcmpadvip = ARGV[7];
+ mcmpadport = ARGV[8];
+ mcmpsubip = ARGV[9];
+ mcmpip = ARGV[10];
+ mcmpport = ARGV[11];
+ delete ARGV[11];
+ delete ARGV[10];
+ delete ARGV[9];
+ delete ARGV[8];
+ delete ARGV[7];
delete ARGV[6];
delete ARGV[5];
delete ARGV[4];
@@ -43,6 +53,11 @@
print " ServerPort : " serverport;
print " ServerSslPort : " serverport;
print " ServerRoot : " serverroot;
+ print " AdvertiseIP : " mcmpadvip;
+ print " AdvertisePort : " mcmpadvport;
+ print " SubnetAdv : " mcmpsubip;
+ print " MCMPIP : " mcmpip;
+ print " MCMPPort : " mcmpport;
filelist["httpd.conf"] = "httpd.conf.in";
filelist["extra/httpd-autoindex.conf"] =
"extra/httpd-autoindex.conf.in";
@@ -162,6 +177,11 @@
gsub( /example.com/, domainname );
gsub( /@@Port@@/, serverport );
gsub( /443/, serversslport );
+ gsub( /@@ADVIP@@/, mcmpadvip );
+ gsub( /23364/, mcmpadvport );
+ gsub( /@@SUBIP@@/, mcmpsubip );
+ gsub( /@@MCMPIP@@/, mcmpip );
+ gsub( /@@MCMPPORT@@/, mcmpport );
print $0 > dstfl;
}
close(srcfl);
Added: trunk/httpd/httpd-2.2/installer/installconf.sh
===================================================================
--- trunk/httpd/httpd-2.2/installer/installconf.sh (rev 0)
+++ trunk/httpd/httpd-2.2/installer/installconf.sh 2008-12-17 10:50:37 UTC (rev 2155)
@@ -0,0 +1,48 @@
+#!/bin/sh
+# Copyright(c) 2008 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Jean-Frederic Clere
+#
+
+echo ""
+echo "Running : `basename $0` $LastChangedDate: 2008-04-21 11:25:11 +0200 (Mon, 21
Apr 2008) $"
+echo ""
+echo "Started : `date`"
+echo "Params : $*"
+echo ""
+
+INSTALL_HOME=`(cd ..; pwd)`
+HTTPD_SERVERNAME=${1-localhost}
+HTTPD_DOMAINNAME=${2-localdomain}
+HTTPD_PORT=${3-8000}
+HTTPD_SSLPORT=${4-8443}
+MCMPADVIP=${5-232.0.0.2}
+MCMPADPORT=${6-23364}
+MCMPSUBIP=${7-all}
+MCMPIP=${8-localhost}
+MCMPPORT=${9-6666}
+
+
+HTTPD_ADMIN=${USERNAME}(a)${HTTPD_SERVERNAME}.${HTTPD_DOMAINNAME}
+HTTPD_ROOT=${INSTALL_HOME}
+
+
+awk -f installconf.awk ${HTTPD_DOMAINNAME} ${HTTPD_SERVERNAME} ${HTTPD_ADMIN}
${HTTPD_PORT} ${HTTPD_SSLPORT} "${HTTPD_ROOT}" ${MCMPADVIP} ${MCMPADPORT}
${MCMPSUBIP} ${MCMPPORT}