Index: greenstone3/trunk/src/java/org/greenstone/server/Server2.java
===================================================================
--- greenstone3/trunk/src/java/org/greenstone/server/Server2.java	(revision 20604)
+++ greenstone3/trunk/src/java/org/greenstone/server/Server2.java	(revision 20618)
@@ -8,6 +8,8 @@
 import java.io.InputStreamReader;
 import java.io.IOException;
+import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.net.UnknownHostException;
 import java.net.URL;
 //import java.net.URLConnection;
@@ -207,6 +209,34 @@
 	    //reloadConfigProperties();
 	    port = config_properties.getProperty("portnumber", port);
-	    host = config_properties.getProperty("host", host);
-
+	    
+	    // The "hosts" property in the config file contains more than one allowed host
+	    // Need to work out the particular host chosen from the address_resolution_method
+	    // Default is address_resolution_method 2: localhost
+	    String addressResolutionMethod = config_properties.getProperty("address_resolution_method");
+	    int address_resolution_method = (addressResolutionMethod == null) ? 2 : Integer.parseInt(addressResolutionMethod);
+	    InetAddress inetAddress = null;
+	    try {
+		inetAddress = InetAddress.getLocalHost();
+	    } catch(UnknownHostException e) {
+		logger_.error(e);
+		logger_.info("Defaulting host IP to "+ host); // use the default		
+		address_resolution_method = 2;
+	    }
+	    switch(address_resolution_method) {
+	    case 0:
+		host = inetAddress.getHostName();
+		break;
+	    case 1:
+		host = inetAddress.getHostAddress();
+		break;
+	    case 2:
+		host = "localhost";
+		break;
+	    case 3:
+		host = "127.0.0.1";
+		break;
+	    default:
+		host = "localhost";		    
+	    }
 	} catch(Exception e) {
 	    recordError("Exception trying to load properties from gsdlsite_cfg. Using default library prefix.", e);
Index: greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java
===================================================================
--- greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java	(revision 20604)
+++ greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java	(revision 20618)
@@ -13,5 +13,5 @@
 import org.greenstone.server.BaseServerSettings;
 
-public class Server2Settings extends BaseServerSettings implements ActionListener
+public class Server2Settings extends BaseServerSettings
 {
     protected JComboBox prefix_combobox;
@@ -41,9 +41,8 @@
 	allowConnections = new JCheckBox(server.dictionary.get(BaseServer.Property.SERVER_SETTINGS+".ExternalAccess"), allowCons);
 	allowConnections.setBackground(bg_color);
-	allowConnections.addActionListener(this);
 	
 	JPanel connect_panel = new JPanel(new GridLayout(4, 1));
 	connect_panel.setBackground(bg_color);
-	connect_panel.setBorder(BorderFactory.createTitledBorder("Connection configuration"));
+	connect_panel.setBorder(BorderFactory.createTitledBorder(server.dictionary.get(BaseServer.Property.SERVER_SETTINGS+".AddressResolutionMethod")));
 
 	hostRadioButtons = new JRadioButton[4];
@@ -58,7 +57,5 @@
 	    hostGroup.add(hostRadioButtons[i]);
 	    hostRadioButtons[i].setBackground(bg_color);
-	    hostRadioButtons[i].setEnabled(!allowCons);
-	}
-	
+	}	
 
 	String addressResolutionMethod = server.config_properties.getProperty("address_resolution_method").trim();
@@ -114,27 +111,28 @@
 	
 	// work out the host (default is address_resolution_method 2: localhost)
-	String host = "localhost";
+	String hosts = "127.0.0.1 localhost";
+	String fixedHostIP = "127.0.0.1";
 	InetAddress inetAddress = null;
 	try {
 	    inetAddress = InetAddress.getLocalHost();
+
+	    fixedHostIP = inetAddress.getHostAddress(); // used for all cases unless things go wrong
+	    hosts = "127.0.0.1 " + fixedHostIP;         // for address_resolution_methods 1 and 3
+
+	    if(address_resolution_method == 2) {
+		hosts = hosts + " localhost";
+	    } else if(address_resolution_method == 0) {
+		hosts = hosts + " " + inetAddress.getHostName() + " localhost";
+	    }
 	} catch(UnknownHostException e) {
 	    logger.error(e);
-	    logger.info("Server2.java reload(): Defaulting host IP to "+ host); // use the default		
+	    logger.info("Server2.java reload(): Defaulting host IP to localhost");
+	    fixedHostIP = "127.0.0.1";
 	    address_resolution_method = 2;
+	    hosts = "127.0.0.1 localhost";
 	}
-	switch(address_resolution_method) {
-	case 0:
-	    host = inetAddress.getHostName();
-	    break;
-	case 1:
-	    host = inetAddress.getHostAddress();
-	    break;
-	case 3:
-	    host = "127.0.0.1";
-	    break;
-	case 2: default:
-	    host = "localhost";		    
-	}
-	newFileLines = scriptReadWrite.queryReplace(newFileLines, "host", host);
+
+	newFileLines = scriptReadWrite.queryReplace(newFileLines, "hosts", hosts);
+	newFileLines = scriptReadWrite.queryReplace(newFileLines, "hostIP", fixedHostIP);
 
 	// address resolution method - onSave() would have updated
@@ -142,14 +140,4 @@
 	newFileLines = scriptReadWrite.queryReplace(newFileLines, "address_resolution_method", Integer.toString(address_resolution_method));
 	
-    }
-
-    public void actionPerformed(ActionEvent e) {
-	boolean toggle = !allowConnections.isSelected();
-	if(e.getSource() == allowConnections) {
-	    for(int i = 0; i < hostRadioButtons.length; i++) {
-		hostRadioButtons[i].setEnabled(toggle);
-	    }
-	}
-    }
-
+    }    
 }
