Changeset 20623 for greenstone3

Show
Ignore:
Timestamp:
17.09.2009 19:28:47 (11 years ago)
Author:
ak19
Message:

No more properties hosts in llssite.cfg and glisite.cfg config files. Now the host IP is always written into these and then written into httpd.conf by gsicontrol.sh.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java

    r20618 r20623  
    111111     
    112112    // 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"; 
    115114    InetAddress inetAddress = null; 
    116115    try { 
    117116        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 
    127118    } catch(UnknownHostException e) { 
    128119        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;       
    133123    } 
    134124 
    135     newFileLines = scriptReadWrite.queryReplace(newFileLines, "hosts", hosts); 
    136     newFileLines = scriptReadWrite.queryReplace(newFileLines, "hostIP", fixedHostIP); 
     125    newFileLines = scriptReadWrite.queryReplace(newFileLines, "hostIP", hostIP); 
    137126 
    138127    // address resolution method - onSave() would have updated