Changeset 32334 for main/trunk/greenstone3
- Timestamp:
- 2018-08-14T15:50:12+12:00 (6 years ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/build.properties.svn
r32309 r32334 11 11 # but not remotely 12 12 tomcat.server=localhost 13 # The port number that tomcat is/will be run on 14 tomcat. port=838313 tomcat.http.port=8383 14 tomcat.https.port=8443 15 15 # Tomcat's shutdown port - this may need to be changed if you are running two or more Tomcats 16 16 tomcat.shutdown.port=8305 … … 161 161 ##listing and description of all the web services deployable on GS3## 162 162 web.services.list=${base.webservice.name} for Greenstone3's core web services, QBR${base.webservice.name} for Query, Browse and Retrieve services 163 164 ## ------------------------------------------------------ ## 165 ## Do not modify any properties that appear after this 166 ## as they are automatically generated. 167 ## ------------------------------------------------------ ## 168 169 ## The port number that tomcat is/will run on by default (i.e. for the default server.protocol value set) -
main/trunk/greenstone3/build.xml
r32333 r32334 100 100 <if><bool><available file="${user.home}/build.properties"/></bool> 101 101 <property file="${user.home}/build.properties"/> 102 </if> 103 104 105 <!-- If internal.tomcat.port not yet set, work it out based on server.protocol 106 Would be great if we could just use nested variables in build.properties 107 https://grokbase.com/t/ant/user/04698xjbp3/nested-variables-in-ant 108 http://ant.apache.org/faq.html#propertyvalue-as-name-for-property 109 https://marc.info/?l=ant-user&m=111231719328847 110 http://ant-contrib.sourceforge.net/tasks/tasks/propertycopy.html 111 http://www.jguru.com/faq/view.jsp?EID=1072238 112 * propfile: 113 https://ant.apache.org/manual/Tasks/propertyfile.html 114 * valid ports range from 1024â49151 115 https://stackoverflow.com/questions/113224/what-is-the-largest-tcp-ip-network-port-number-allowable-for-ipv4 116 --> 117 118 <!-- If internal.tomcat.port not yet set, work it out based on server.protocol 119 Would be great if we could just use nested variables in build.properties 120 https://grokbase.com/t/ant/user/04698xjbp3/nested-variables-in-ant 121 http://ant.apache.org/faq.html#propertyvalue-as-name-for-property 122 https://marc.info/?l=ant-user&m=111231719328847 123 http://ant-contrib.sourceforge.net/tasks/tasks/propertycopy.html 124 http://www.jguru.com/faq/view.jsp?EID=1072238 125 * propfile: 126 https://ant.apache.org/manual/Tasks/propertyfile.html 127 * valid ports range from 1024â49151 128 https://stackoverflow.com/questions/113224/what-is-the-largest-tcp-ip-network-port-number-allowable-for-ipv4 129 --> 130 <!--<if> 131 <bool><not><isset property="internal.tomcat.port"/></not></bool>--> 132 <if> 133 <bool> 134 <not> 135 <or> 136 <and> 137 <equals arg1="${server.protocol}" arg2="http" trim="true" casesensitive="false" forcestring="true"/> 138 <isset property="tomcat.http.port"/> 139 <matches string="${tomcat.http.port}" pattern="^\d{3,4}\s*$"/> 140 </and> 141 <and> 142 <equals arg1="${server.protocol}" arg2="https" trim="true" casesensitive="false" forcestring="true"/> 143 <isset property="tomcat.https.port"/> 144 <matches string="${tomcat.https.port}" pattern="^\d{3,4}\s*$"/> 145 </and> 146 </or> 147 </not> 148 </bool> 149 <fail>ERROR: Unable to set tomcat.port. 150 In file build.properties server.protocol=${server.protocol} and requires at minimum that its 151 matching tomcat.${server.protocol}.port property line be set and is assigned a valid port number. 152 (Ensure any other enabled tomcat port is valid too)</fail> 153 <!--<echo>Uncomment at least the tomcat.${server.protocol}.port line in build.properties.</echo>--> 154 <!--<property name="internal.tomcat.port" value=""/>--> 155 <else> 156 <condition property="internal.tomcat.port" value="${tomcat.https.port}" else="${tomcat.http.port}"> 157 <equals arg1="${server.protocol}" arg2="https" trim="true" casesensitive="false" forcestring="true"/> 158 </condition> 159 </else> 160 </if> 161 <!--</if>--> 162 163 <!-- Set autogenerated properties (properties we calculate here in build.xml) 164 in build.properties. https://ant.apache.org/manual/Tasks/propertyfile.html 165 For now only internal.tomcat.port is determined by build.xml 166 and written out to build.properties as tomcat.port. 167 Internally, this file still uses internal.tomcat.port as any old value 168 read in from build.properties for tomcat.port can't be changed in memory 169 even though we can write it back out again to build.properties. 170 --> 171 <if> 172 <bool><isset property="internal.tomcat.port"/></bool> 173 <propertyfile file="build.properties"> 174 <entry key="tomcat.port" value="${internal.tomcat.port}"/> 175 </propertyfile> 102 176 </if> 103 177 … … 851 925 852 926 <target name="get-default-servlet-url"> 853 <echo>${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}${server.default.servlet}</echo>927 <echo>${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}${server.default.servlet}</echo> 854 928 </target> 855 929 856 930 <target name="get-solr-servlet-url"> 857 <echo>${server.protocol}://${tomcat.server}:${ tomcat.port}/${solr.context}</echo>931 <echo>${server.protocol}://${tomcat.server}:${internal.tomcat.port}/${solr.context}</echo> 858 932 </target> 859 933 … … 945 1019 </if> 946 1020 <if><bool><isset property="install.flax"/></bool> 947 <property name="url" value="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}/flax"/>1021 <property name="url" value="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}/flax"/> 948 1022 <else> 949 <property name="url" value="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}/"/>1023 <property name="url" value="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}/"/> 950 1024 </else> 951 1025 </if> … … 1000 1074 <target name="accept-properties" unless="properties.accepted"> 1001 1075 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory: 1076 server.protocol=${server.protocol} 1002 1077 tomcat.server=${tomcat.server} 1003 tomcat.port=${tomcat.port} 1078 <!--tomcat.port=${internal.tomcat.port}--> 1079 tomcat.http.port=${tomcat.http.port} 1080 tomcat.https.port=${tomcat.https.port} 1004 1081 tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed) 1005 1082 proxy.host=${proxy.host} … … 1014 1091 </target> 1015 1092 1093 <!-- Need to list this first in depends for any target that will be using internal.tomcat.port --> 1094 <target name="tomcat-init"> 1095 <if> 1096 <bool><not><isset property="internal.tomcat.port"/></not></bool> 1097 <fail>ERROR: no tomcat port, so tomcat operations won't proceed. 1098 tomcat.${server.protocol}.port is not set or not valid. 1099 Correct this in build.properties.</fail> 1100 </if> 1101 </target> 1102 1103 1016 1104 <!-- this sets up some initial properties --> 1017 1105 <target name="init"> … … 1038 1126 </condition> 1039 1127 1040 <echo> tomcat.port = ${tomcat.port}</echo>1128 <echo>internal.tomcat.port = ${internal.tomcat.port}</echo> 1041 1129 1042 1130 <condition property="proxy.present"> … … 1327 1415 </target> 1328 1416 1329 <target name="configure-web" depends=" init,perl-for-building"1417 <target name="configure-web" depends="tomcat-init,init,perl-for-building" 1330 1418 description="Configure only the web app config files"> 1331 1419 <!-- we want a unix path in the global.properties file --> … … 1347 1435 <filter token="gsdl3writablehome" value="${src.gsdl3.writablehome.unix}"/> 1348 1436 <filter token="gsdl3version" value="${app.version}"/> 1437 <filter token="server.protocol" value="${server.protocol}"/> 1349 1438 <filter token="tomcat.server" value="${tomcat.server}"/> 1350 <filter token="tomcat.port" value="${tomcat.port}"/> 1439 <filter token="tomcat.port" value="${internal.tomcat.port}"/> 1440 <filter token="tomcat.http.port" value="${tomcat.http.port}"/> 1441 <filter token="tomcat.https.port" value="${tomcat.https.port}"/> 1351 1442 <filter token="greenstone.context" value="${greenstone.context}"/> 1352 1443 <filter token="derbyserver" value="${derby.server}"/> … … 1494 1585 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/> 1495 1586 1496 <target name="configure-tomcat-local" depends=" init,perl-for-building" if="tomcat.islocal">1587 <target name="configure-tomcat-local" depends="tomcat-init,init,perl-for-building" if="tomcat.islocal"> 1497 1588 <!-- re-setup the server.xml file --> 1498 1589 <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml.in" 1499 1590 tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true"> 1500 1591 <filterset> 1501 <filter token="port" value="${ tomcat.port}"/>1592 <filter token="port" value="${internal.tomcat.port}"/> 1502 1593 <filter token="shutdown-port" value="${tomcat.shutdown.port}"/> 1503 1594 </filterset> … … 1575 1666 on how to use this with eclipse 1576 1667 --> 1577 <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends=" init" if="tomcat.islocal">1668 <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="tomcat-init,init" if="tomcat.islocal"> 1578 1669 <property name="tomcat.classpath" refid="local.tomcat.classpath"/> 1579 1670 <property name="tomcat.path" refid="local.tomcat.path"/> … … 1622 1713 <waitfor maxwait="5" maxwaitunit="second"> 1623 1714 <and> 1624 <socket server="${tomcat.server}" port="${ tomcat.port}"/>1625 <http url="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}/index.html"/>1715 <socket server="${tomcat.server}" port="${internal.tomcat.port}"/> 1716 <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}/index.html"/> 1626 1717 </and> 1627 1718 </waitfor> … … 1632 1723 <if><bool><istrue value="${tomcat.isstarted}"/></bool> 1633 1724 <echo>**************************************</echo> 1634 <echo>A WEB SERVER IS ALREADY RUNNING ON ${server.protocol}://${tomcat.server}:${ tomcat.port}. NOT STARTING.</echo>1725 <echo>A WEB SERVER IS ALREADY RUNNING ON ${server.protocol}://${tomcat.server}:${internal.tomcat.port}. NOT STARTING.</echo> 1635 1726 <echo>**************************************</echo> 1636 1727 <else> … … 1641 1732 1642 1733 <!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ --> 1643 <target name="force-start-tomcat" description="Startup only Tomcat" depends=" init" if="tomcat.islocal">1734 <target name="force-start-tomcat" description="Startup only Tomcat" depends="tomcat-init,init" if="tomcat.islocal"> 1644 1735 1645 1736 <property name="tomcat.classpath" refid="local.tomcat.classpath"/> … … 1687 1778 <waitfor maxwait="5" maxwaitunit="second"> 1688 1779 <and> 1689 <socket server="${tomcat.server}" port="${ tomcat.port}"/>1690 <http url="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}/index.html"/>1780 <socket server="${tomcat.server}" port="${internal.tomcat.port}"/> 1781 <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}/index.html"/> 1691 1782 </and> 1692 1783 </waitfor> … … 1695 1786 1696 1787 <!--ant task http: http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/condition/Http.html--> 1697 <target name="reconfigure" description="Reconfigure the message router" >1788 <target name="reconfigure" description="Reconfigure the message router" depends="tomcat-init"> 1698 1789 <waitfor maxwait="5" maxwaitunit="second"> 1699 <http url="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}${server.default.servlet}?a=s&sa=c"/>1790 <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}${server.default.servlet}?a=s&sa=c"/> 1700 1791 </waitfor> 1701 1792 </target> 1702 1793 1703 1794 <!--Command-line args to Ant: http://www.jguru.com/faq/view.jsp?EID=471794--> 1704 <target name="reconfigure-collection" description="Reconfigure the collection" >1795 <target name="reconfigure-collection" description="Reconfigure the collection" depends="tomcat-init"> 1705 1796 <waitfor maxwait="5" maxwaitunit="second"> 1706 <http url="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}${server.default.servlet}?a=s&sa=c&sc=${collection}"/>1797 <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}${server.default.servlet}?a=s&sa=c&sc=${collection}"/> 1707 1798 </waitfor> 1708 1799 </target> … … 1735 1826 might still be in use for some moments. We test the URL with the http condition since it's likelier to 1736 1827 fail sooner if the server has indeed been stopped. --> 1737 <target name="check-tomcat-running" >1828 <target name="check-tomcat-running" depends="tomcat-init"> 1738 1829 <condition property="tomcat.isrunning"> 1739 <!--<http url="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}"/>-->1740 <http url="${server.protocol}://${tomcat.server}:${ tomcat.port}"/>1830 <!--<http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}"/>--> 1831 <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}"/> 1741 1832 </condition> 1742 1833 </target> … … 1745 1836 <target name="verbose-check-tomcat-running"> 1746 1837 <condition property="tomcat.isrunning" value="true" else="false"> 1747 <http url="${server.protocol}://${tomcat.server}:${ tomcat.port}"/>1838 <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}"/> 1748 1839 </condition> 1749 1840 <echo>Tomcat is running: ${tomcat.isrunning}</echo> … … 1763 1854 both stop and start, both of which need to do tomcat checks. Each property can be set only once during 1764 1855 an invocation with ant. So ant restart will need two properties to store each of the tomcat checks --> 1765 <target name="check-tomcat-started" >1856 <target name="check-tomcat-started" depends="tomcat-init"> 1766 1857 <condition property="tomcat.isstarted"> 1767 <http url="${server.protocol}://${tomcat.server}:${ tomcat.port}"/>1858 <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}"/> 1768 1859 </condition> 1769 1860 </target> … … 1782 1873 <echo>Waiting for the server to shutdown... (${wait.numchecks} seconds max)</echo> 1783 1874 <waitfor maxwait="${wait.numchecks}" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="tomcat.timedout"> 1784 <not><socket server="${tomcat.server}" port="${ tomcat.port}"/></not>1875 <not><socket server="${tomcat.server}" port="${internal.tomcat.port}"/></not> 1785 1876 </waitfor> 1786 1877 … … 1790 1881 </bool> 1791 1882 <property name="tomcat.isrunning" value="true"/> 1792 <echo>WARNING: Checked the socket ${wait.numchecks} times, but port ${ tomcat.port} is still busy.</echo>1883 <echo>WARNING: Checked the socket ${wait.numchecks} times, but port ${internal.tomcat.port} is still busy.</echo> 1793 1884 <else> 1794 1885 <echo>Tomcat is stopped.</echo> … … 2055 2146 </target> 2056 2147 2057 <target name="soap-deploy-site" depends=" init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"2148 <target name="soap-deploy-site" depends="tomcat-init,init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site" 2058 2149 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/> 2059 2150 … … 2062 2153 <classpath refid="compile.classpath"/> 2063 2154 <arg value="-l"/> 2064 <arg value="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}/servlet/AxisServlet"/>2155 <arg value="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}/servlet/AxisServlet"/> 2065 2156 <arg file="${basedir}/resources/soap/deploy.wsdd"/> 2066 2157 </java> … … 2068 2159 </target> 2069 2160 2070 <target name="soap-undeploy-site" depends=" get-undeploy-service-name"2161 <target name="soap-undeploy-site" depends="tomcat-init,get-undeploy-service-name" 2071 2162 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."> 2072 2163 <filter token="servicesname" value="${axis.undeploy.servicename}"/> … … 2078 2169 <classpath refid="compile.classpath"/> 2079 2170 <arg value="-l"/> 2080 <arg value="${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}/servlet/AxisServlet"/>2171 <arg value="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}/servlet/AxisServlet"/> 2081 2172 <arg file="${basedir}/resources/soap/undeploy.wsdd"/> 2082 2173 </java> … … 2086 2177 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server 2087 2178 with the default servicename of localsite--> 2088 <target name="deploy-localsite" depends=" init"2179 <target name="deploy-localsite" depends="tomcat-init,init" 2089 2180 description="Deploy the SOAP server for localsite. Will start and stop Tomcat."> 2090 2181 <antcall target="force-start-tomcat"/> … … 2110 2201 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename"> 2111 2202 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy. 2112 To find out which web services you've got deployed, point your browser to ${server.protocol}://${tomcat.server}:${ tomcat.port}/greenstone3/services2203 To find out which web services you've got deployed, point your browser to ${server.protocol}://${tomcat.server}:${internal.tomcat.port}/greenstone3/services 2113 2204 Or press Enter for undeploying the default:localsite /></input> 2114 2205 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo> … … 3397 3488 </target> 3398 3489 3399 <target name="run-collection-tests" >3490 <target name="run-collection-tests" depends="tomcat-init"> 3400 3491 <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool> 3401 3492 <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co http://svn.greenstone.org/gs3-extensions/testing/trunk/src testing" in the ext directory of your Greenstone 3 installation. </fail> … … 3409 3500 <java classname="org.junit.runner.JUnitCore" fork="true"> 3410 3501 <arg value="gstests.TestClass"/> 3411 <jvmarg value="-DSERVERURL=${server.protocol}://${tomcat.server}:${ tomcat.port}${app.path}${server.default.servlet} "/>3502 <jvmarg value="-DSERVERURL=${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}${server.default.servlet} "/> 3412 3503 <classpath> 3413 3504 <fileset dir="${basedir}/ext/testing/lib/java"> -
main/trunk/greenstone3/resources/web/global.properties.svn
r32311 r32334 15 15 16 16 # tomcat info 17 [email protected]@ 17 18 [email protected]@ 18 19 [email protected]@ 20 [email protected]@ 21 [email protected]@ 19 22 [email protected]@ 20 23 [email protected]@ -
main/trunk/greenstone3/src/java/org/greenstone/server/BaseServerSettings.java
r29845 r32334 52 52 catch(Exception e){ 53 53 logger.error(e); 54 System.err.println("Unable to proceed. Port number property " + BaseServer.Property.WEB_PORT + " doesn't exist\nor contains a non-numeric value"); 55 exit(-1); 54 56 } 55 57 -
main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java
r27869 r32334 153 153 154 154 //protocol 155 if (properties.getProperty(" tomcat.protocol") == null || properties.getProperty("tomcat.protocol").equals(""))155 if (properties.getProperty("server.protocol") == null || properties.getProperty("server.protocol").equals("")) 156 156 { 157 157 protocolSpecifier = "http://"; … … 159 159 else 160 160 { 161 if (properties.getProperty(" tomcat.protocol").endsWith("://"))162 { 163 protocolSpecifier = properties.getProperty(" tomcat.protocol");161 if (properties.getProperty("server.protocol").endsWith("://")) 162 { 163 protocolSpecifier = properties.getProperty("server.protocol"); 164 164 } 165 165 else 166 166 { 167 protocolSpecifier = properties.getProperty(" tomcat.protocol") + "://";167 protocolSpecifier = properties.getProperty("server.protocol") + "://"; 168 168 } 169 169 }
Note:
See TracChangeset
for help on using the changeset viewer.