Changeset 20623
- Timestamp:
- 2009-09-17T19:28:47+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java
r20618 r20623 111 111 112 112 // work out the host (default is address_resolution_method 2: localhost) 113 String hosts = "127.0.0.1 localhost"; 114 String fixedHostIP = "127.0.0.1"; 113 String hostIP = "127.0.0.1"; 115 114 InetAddress inetAddress = null; 116 115 try { 117 116 inetAddress = InetAddress.getLocalHost(); 118 119 fixedHostIP = inetAddress.getHostAddress(); // used for all cases unless things go wrong 120 hosts = "127.0.0.1 " + fixedHostIP; // for address_resolution_methods 1 and 3 121 122 if(address_resolution_method == 2) { 123 hosts = hosts + " localhost"; 124 } else if(address_resolution_method == 0) { 125 hosts = hosts + " " + inetAddress.getHostName() + " localhost"; 126 } 117 hostIP = inetAddress.getHostAddress(); // used for all cases unless an Exception is thrown here 127 118 } catch(UnknownHostException e) { 128 119 logger.error(e); 129 logger.info("Server2.java reload(): Defaulting host IP to localhost"); 130 fixedHostIP = "127.0.0.1"; 131 address_resolution_method = 2; 132 hosts = "127.0.0.1 localhost"; 120 logger.info("Server2.java reload(): Defaulting host URL to localhost"); 121 hostIP = "127.0.0.1"; 122 address_resolution_method = 2; 133 123 } 134 124 135 newFileLines = scriptReadWrite.queryReplace(newFileLines, "hosts", hosts); 136 newFileLines = scriptReadWrite.queryReplace(newFileLines, "hostIP", fixedHostIP); 125 newFileLines = scriptReadWrite.queryReplace(newFileLines, "hostIP", hostIP); 137 126 138 127 // address resolution method - onSave() would have updated
Note:
See TracChangeset
for help on using the changeset viewer.