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/Server2Settings.java

    r22085 r23251  
    2020    protected JRadioButton[] hostRadioButtons = new JRadioButton[4];
    2121
    22     // 0 to 3: 0 is resolve (hostname) from local IP, 1 is local IP address, 2 is localhost, 3 is 127.0.0.1
     22    // 0 to 3: 0 is resolved (hostname) from local IP, 1 is local IP address, 2 is localhost, 3 is 127.0.0.1
    2323    protected int address_resolution_method = 2;
    2424    protected int externalaccess = 0;
     
    115115    // work out the host (default is address_resolution_method 2: localhost)
    116116    String hostIP = "127.0.0.1";
     117    String hosts = "";
    117118    InetAddress inetAddress = null;
    118119    try {
    119120        inetAddress = InetAddress.getLocalHost();
     121        hosts = inetAddress.getHostName();
    120122        hostIP = inetAddress.getHostAddress(); // used for all cases unless an Exception is thrown here
    121123    } catch(UnknownHostException e) {
     
    123125        logger.info("Server2.java reload(): Defaulting host URL to localhost");
    124126        hostIP = "127.0.0.1";
     127        hosts = "";
    125128        address_resolution_method = 2;     
    126129    }
    127130
    128131    newFileLines = scriptReadWrite.replaceOrAddLine(newFileLines, "hostIP", hostIP, true);
     132    newFileLines = scriptReadWrite.replaceOrAddLine(newFileLines, "hosts", hosts, true);
    129133
    130134    // address resolution method - onSave() would have updated
Note: See TracChangeset for help on using the changeset viewer.