Changeset 23252 for main


Ignore:
Timestamp:
2010-10-29T21:30:10+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 greenstone 3's server.jar code (Server2.java and Server2Settings.java), and so also regenerated server.jar itself, 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.

Location:
main/trunk/greenstone2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/glisite.cfg.in

    r20622 r23252  
    1010address_resolution_method=2
    1111hostIP=
     12hosts=
  • main/trunk/greenstone2/gsicontrol.bat

    r22613 r23252  
    203203FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^portnumber "%configfile%"') do set port=%%G
    204204FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hostIP "%configfile%"') do set hostIP=%%G
     205FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hosts "%configfile%"') do set hosts=%%G
    205206FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^externalaccess "%configfile%"') do set allowfromall=%%G
    206207
     
    218219set /p port=Enter port number to use:
    219220set /p hostIP=Enter host IP to allow (127.0.0.1 is included by default):
     221set /p hosts=Enter hostname or list of hosts to allow (localhost included by default):
    220222set /p allowfromall=Allow external connections [yes/no]:
    221223
     
    243245if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" "%GSDLHOME%\bin\windows\stophttpd.exe" %GS2_APACHE_HTTPD_SIGNAL% SILENT
    244246echo Setting config file to use port %port%
    245 type "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf.in" | %_sed% "s@\*\*PORT\*\*@%port%@g" | %_sed% "s@\*\*CONNECTPERMISSION\*\*@%allowfromall%@g" | %_sed% "s@\*\*HOST_IP\*\*@%hostIP%@g" | %_sed% "s@\*\*COLLECTHOME\*\*@%safecollectpath%@g" | %_sed% "s@\*\*GSDLHOME\*\*@%safepath%@g" | %_sed% "s@\*\*APACHE_HOME_OS\*\*@%safepath%\/apache-httpd\/%GSDLOS%@g" > "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf"
     247type "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf.in" | %_sed% "s@\*\*PORT\*\*@%port%@g" | %_sed% "s@\*\*CONNECTPERMISSION\*\*@%allowfromall%@g" | %_sed% "s@\*\*HOST_IP\*\*@%hostIP%@g" | %_sed% "s@\*\*HOSTS\*\*@%hosts%@g" | %_sed% "s@\*\*COLLECTHOME\*\*@%safecollectpath%@g" | %_sed% "s@\*\*GSDLHOME\*\*@%safepath%@g" | %_sed% "s@\*\*APACHE_HOME_OS\*\*@%safepath%\/apache-httpd\/%GSDLOS%@g" > "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf"
    246248echo Type '%0 web-start' to start the web server running on port %port%
    247249echo Done
  • main/trunk/greenstone2/gsicontrol.sh

    r23134 r23252  
    5656    echo "Enter host IP to allow (127.0.0.1 is included by default):"
    5757    read hostIP ;
     58    echo "Enter hostname or list of hosts to allow (localhost included by default):"
     59    read hosts ;
    5860    echo "Allow external connections [yes/no]:"
    5961    read connection ;   
     
    6163        allowfromall="Allow"
    6264    else
    63     allowfromall="Deny"
     65        allowfromall="Deny"
    6466    fi
    6567
     
    8587    | sed "s@\*\*CONNECTPERMISSION\*\*@$allowfromall@g" \
    8688    | sed "s@\*\*HOST_IP\*\*@$hostIP@g" \
     89    | sed "s@\*\*HOSTS\*\*@$hosts@g" \
    8790    | sed "s@\*\*COLLECTHOME\*\*@$collecthome@g" \
    8891    | sed "s@\*\*GSDLHOME\*\*@$GSDLHOME@g" \
     
    113116    port=`egrep "^portnumber" $configfile | awk -F= '{print $2}'` ;
    114117    hostIP=`egrep "^hostIP" $configfile | awk -F= '{print $2}'` ;
     118    hosts=`egrep "^hosts" $configfile | awk -F= '{print $2}'` ;   
    115119   
    116120    externalaccess=`egrep "^externalaccess" $configfile | awk -F= '{print $2}'` ;
     
    121125    fi
    122126
    123     echo -e "$port\n$hostIP\n$externalaccess" | configure-port-and-connection ;
     127    echo -e "$port\n$hostIP\n$hosts\n$externalaccess" | configure-port-and-connection ;
    124128    if test -e "$GSDLHOME/apache-httpd/$GSDLOS/conf/httpd.conf" ; then
    125129    echo $MONITOR_SUCCESS;
  • main/trunk/greenstone2/llssite.cfg.in

    r20622 r23252  
    1010address_resolution_method=2
    1111hostIP=
     12hosts=
  • main/trunk/greenstone2/runtime-src/packages/apache-httpd/httpd.conf.in

    r22635 r23252  
    424424     Order deny,allow
    425425     **CONNECTPERMISSION** from all
    426      Allow from 127.0.0.1 **HOST_IP**
     426     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
    427427  </Directory>
    428428
     
    433433     Order deny,allow
    434434     **CONNECTPERMISSION** from all
    435      Allow from 127.0.0.1 **HOST_IP**
     435     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
    436436  </Directory> 
    437437 
     
    442442     Order deny,allow
    443443     **CONNECTPERMISSION** from all
    444      Allow from 127.0.0.1 **HOST_IP**
     444     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
    445445  </Directory>
  • main/trunk/greenstone2/runtime-src/packages/apache-httpd/windows-httpd.conf.in

    r22613 r23252  
    489489     Order deny,allow
    490490     **CONNECTPERMISSION** from all
    491      Allow from 127.0.0.1 **HOST_IP**
     491     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
    492492  </Directory>
    493493 
     
    498498     Order deny,allow
    499499     **CONNECTPERMISSION** from all
    500      Allow from 127.0.0.1 **HOST_IP**
     500     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
    501501  </Directory>
    502502
     
    507507     Order deny,allow
    508508     **CONNECTPERMISSION** from all
    509      Allow from 127.0.0.1 **HOST_IP**
     509     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
    510510  </Directory>
Note: See TracChangeset for help on using the changeset viewer.