Ignore:
Timestamp:
2010-10-29T21:14:42+13:00 (13 years ago)
Author:
sjm84
Message:

The localhost and hostname did not work on the Ubuntu here, but should have been working. It does work if hostname and localhost are written into the httpd.conf file. To get it to do that, made changes to the server.jar code, and so also server.jar, as well as GS2 scripts and config files (httpd.conf.in files for linux and windows), llssite.cfg.in, glisite.cfg.in and gsicontrol.bat and .sh

File:
1 edited

Legend:

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

    r22660 r23251  
    135135    }
    136136   
     137    // For some machines, localhost is not sufficient,
     138    // need hostname defined as well (e.g. Ubuntu 10.10)
     139    InetAddress inetAddress = null;
     140    try {
     141        inetAddress = InetAddress.getLocalHost();
     142        String hosts = inetAddress.getHostName();
     143        ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
     144        ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file);
     145        scriptReadWrite.replaceOrAddLine(fileLines, "hosts", hosts, true);
     146        scriptReadWrite.writeOutFile(config_properties_file, fileLines);
     147    } catch(UnknownHostException e) {
     148        // Unable to get hostname, need to try for the default localhost without it
     149    }       
     150
    137151    // If the GSI is set to NOT autoenter/autostart the server, then write url=URL_PENDING out to the file.
    138152    // When the user finally presses the Enter Library button and so has started up the server, the correct
     
    251265        logger_.info("Defaulting host IP to "+ host); // use the default       
    252266        address_resolution_method = 2;
     267        inetAddress = null;
    253268        }
    254269        switch(address_resolution_method) {
Note: See TracChangeset for help on using the changeset viewer.