Index: /gs3-extensions/solr/trunk/src/solr-tomcat-context.xml.in
===================================================================
--- /gs3-extensions/solr/trunk/src/solr-tomcat-context.xml.in	(revision 30035)
+++ /gs3-extensions/solr/trunk/src/solr-tomcat-context.xml.in	(revision 30036)
@@ -9,5 +9,5 @@
   
   <!-- Allow this machine: 127.0.0.1 (IPv4) and 0:0:0:0:0:0:0:1 (IPv6, needed on the windows we tested this on) -->
-  <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="(127\.0\.0\.1|0:0:0:0:0:0:0:1)"/>
+  <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="(127\.0\.0\.1|0:0:0:0:0:0:0:1@IPv4@)"/>
   
 </Context>
Index: /main/trunk/greenstone3/IPv4.bat
===================================================================
--- /main/trunk/greenstone3/IPv4.bat	(revision 30036)
+++ /main/trunk/greenstone3/IPv4.bat	(revision 30036)
@@ -0,0 +1,28 @@
+@echo off
+for /f "usebackq tokens=2 delims=:" %%a in (`ipconfig ^| find "IPv4"`) do (set result=%%a)
+
+:: To lop off extra space in front of IPv4 number, end with:
+::do (set result=%a& echo %result:~1%)
+:: Alternative: for /f "tokens=2 delims=:" %a in ('ipconfig ^| findstr /C:"IPv4 Address"') do echo %a
+:: still need to remove space up front for that too.
+
+:: removes extra space in front
+set result=%result:~1%
+
+:: The above produces the IPv4 number, e.g. 100.200.300.45
+:: Still need to replace . with \.
+:: http://scripts.dragon-it.co.uk/scripts.nsf/docs/batch-search-replace-substitute!OpenDocument&ExpandSection=3&BaseTarget=East&AutoFramed
+:: Syntax: %string:SEARCH=REPLACE%
+set result=%result:.=\.%
+
+:: http://stackoverflow.com/questions/2541767/what-is-the-proper-way-to-test-if-variable-is-empty-in-a-batch-file-if-not-1
+:: Make sure it is not the empty string or a string of spaces
+:: Test by setting result to space
+::set result= 
+set result=%result: =%
+
+::if not "%result%" == "" 
+::set result=^|%result%
+
+:: Echo a vertical bar up front, regardless of whether the result is empty
+echo ^|%result%
Index: /main/trunk/greenstone3/IPv4.sh
===================================================================
--- /main/trunk/greenstone3/IPv4.sh	(revision 30036)
+++ /main/trunk/greenstone3/IPv4.sh	(revision 30036)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#http://www.wikihow.com/Find-Your-IP-Address-on-a-Mac#Finding_Your_Internal_IP_Using_the_Terminal_sub
+#http://stackoverflow.com/questions/1469849/how-to-split-one-string-into-multiple-strings-in-bash-shell
+#http://www.linuxforums.org/forum/red-hat-fedora-linux/193076-ifconfig-doesnt-display-ipv4-address.html
+
+
+# The following echoes the IPv4, e.g. 100.200.300.45
+# But need to still replace the . with \.
+
+#echo `ifconfig | grep "inet " | grep -v 127.0.0.1`|cut -d' ' -f 2|cut -d':' -f 2
+
+
+tmp=`ifconfig | grep "inet " | grep -v 127.0.0.1`
+
+tmp=`echo $tmp|cut -d' ' -f 2|cut -d':' -f 2`
+
+#http://stackoverflow.com/questions/13210880/replace-one-substring-for-another-string-in-shell-script
+#${original_string//searchterm/$string_to_replace_searchterm_with}
+replace="."
+replacement="\."
+
+tmp=${tmp//$replace/$replacement}
+
+# next, if the tmp variable is not the empty string, prefix the | operator
+# http://unix.stackexchange.com/questions/146942/how-can-i-test-if-a-variable-is-empty-or-contains-only-spaces
+# Can just return | if $tmp is empty, as that doesn't really matter. Will be consistent with windows
+if [[ ! -z "${tmp// }" ]]; then
+	tmp="|$tmp"
+else
+	tmp="|"
+fi
+
+
+echo $tmp
Index: /main/trunk/greenstone3/build.xml
===================================================================
--- /main/trunk/greenstone3/build.xml	(revision 30035)
+++ /main/trunk/greenstone3/build.xml	(revision 30036)
@@ -1428,8 +1428,14 @@
 
     <!-- set up the solr context -->
+    
+    <exec executable="${basedir}/IPv4.sh" os="${os.unix}" failonerror="false" outputproperty="ipv4.val"/>
+    <exec executable="${basedir}/IPv4.bat" osfamily="windows" failonerror="false" outputproperty="ipv4.val"/>
+
+
     <copy file="${basedir}/ext/solr/solr-tomcat-context.xml.in" tofile="${packages.home}/tomcat/conf/Catalina/localhost/solr.xml" overwrite="true">
       <filterset>
         <filter token="gsdl3webhome" value="${web.writablehome}"/>
 	<filter token="tomcathome" value="${basedir}/packages/tomcat"/>
+	<filter token="IPv4" value="${ipv4.val}"/>
       </filterset>
     </copy>
