[19278] | 1 | @echo off
|
---|
| 2 |
|
---|
[24829] | 3 | setlocal enabledelayedexpansion
|
---|
| 4 |
|
---|
[20262] | 5 | ::set testdone=0
|
---|
[23966] | 6 | set startdir=%CD%
|
---|
[23987] | 7 | cd /d "%~dp0"
|
---|
| 8 | ::we're now in the "%GSDLHOME%" folder
|
---|
| 9 | call setup.bat
|
---|
[23949] | 10 |
|
---|
[23966] | 11 | ::set _sed="%GSDLHOME%\bin\windows\sed.exe"
|
---|
| 12 | :: NOTE: no quotes allowed around the following, since it's used inside
|
---|
| 13 | :: a FOR statement executing a command already embedded in quotes
|
---|
| 14 | set _sed=bin\windows\sed.exe
|
---|
| 15 |
|
---|
[23949] | 16 | set cgibin=cgi-bin
|
---|
| 17 | ::set cgibin=cgi-bin\windows
|
---|
| 18 |
|
---|
[19278] | 19 | set target=%1
|
---|
| 20 | set configfile=%2
|
---|
[20906] | 21 | :: remove any quotes around configfile, if we were given parameter configfile
|
---|
| 22 | :: To test for the existence of a cmdline parameter: http://ss64.com/nt/if.html
|
---|
| 23 | if not [%2] == [] set configfile=%configfile:"=%
|
---|
[19278] | 24 |
|
---|
[20262] | 25 | :: Construct the signal using the unique GS2 installation
|
---|
[20906] | 26 | :: directory (after replacing spaces, colons and backslashes)
|
---|
| 27 | set signal=%GSDLHOME: =_%
|
---|
[24829] | 28 | for /F "delims=*" %%T in ('"echo !signal!| !_sed! s@[\\:]@_@g"') do set signal=%%T
|
---|
[20262] | 29 | set GS2_APACHE_HTTPD_SIGNAL=GS2_APACHE_HTTPD_%signal%
|
---|
[20906] | 30 | set signal=
|
---|
[20262] | 31 | rem echo Signal is: %GS2_APACHE_HTTPD_SIGNAL%
|
---|
| 32 |
|
---|
[19970] | 33 | :: Need to get greenstone installation directory
|
---|
| 34 | :: set cwd=%CD%
|
---|
[19278] | 35 |
|
---|
[19970] | 36 | set MONITOR_SUCCESS=MAKE SUCCESSFUL
|
---|
| 37 | set MONITOR_FAILED=MAKE FAILED
|
---|
| 38 | set MONITOR_FINISHED=MAKE DONE
|
---|
| 39 |
|
---|
[19278] | 40 | :: check that we have >=1 and <=2 arguments
|
---|
| 41 | :chkargs
|
---|
[20262] | 42 | if "%target%" == "" goto usage
|
---|
| 43 | if not "%3" == "" goto usage
|
---|
[19278] | 44 | goto begincmd
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | :usage
|
---|
| 48 | echo.
|
---|
| 49 | echo Usage: %0 command
|
---|
| 50 | echo where command is any of the following:
|
---|
[19970] | 51 | echo web-start
|
---|
| 52 | echo web-stop
|
---|
| 53 | echo web-restart
|
---|
[20262] | 54 | ::echo web-status
|
---|
| 55 | ::echo web-graceful
|
---|
[19278] | 56 | echo configure-admin
|
---|
| 57 | echo configure-web [config-filename]
|
---|
| 58 | echo configure-apache [config-filename]
|
---|
| 59 | echo configure-cgi
|
---|
[23945] | 60 | echo reset-gsdlhome [config-filename]
|
---|
[20637] | 61 | echo set-port
|
---|
[20262] | 62 | echo test-gsdlhome
|
---|
| 63 | echo web-stop-tested
|
---|
[19278] | 64 | echo.
|
---|
| 65 | goto exit
|
---|
| 66 |
|
---|
| 67 |
|
---|
| 68 | :begincmd
|
---|
| 69 | :: web-stop-tested command assumes GSDLHOME/greenstone environment is already set
|
---|
| 70 | if "%target%" == "web-stop-tested" goto stoptest
|
---|
| 71 |
|
---|
| 72 | :: For all other commands, the greenstone environment needs to be set first before they can be run
|
---|
| 73 | :testgsdl
|
---|
[20159] | 74 | if NOT "%GSDLHOME%" == "" if NOT "%GSDLOS%" == "" goto commands
|
---|
[20338] | 75 | echo.
|
---|
| 76 | echo Environment variable GSDLHOME (or GSDLOS) not set.
|
---|
| 77 | echo This needs to be set to run the gsicontrol command %target%.
|
---|
| 78 | echo Have you run setup.bat?
|
---|
| 79 | echo.
|
---|
| 80 | goto exit
|
---|
[19278] | 81 |
|
---|
| 82 |
|
---|
| 83 | ::MAIN MENU
|
---|
| 84 | :commands
|
---|
[20262] | 85 | echo.
|
---|
| 86 | echo Using:
|
---|
| 87 | echo GSDLHOME = %GSDLHOME%
|
---|
| 88 | echo GSDLOS = %GSDLOS%
|
---|
| 89 | echo.
|
---|
| 90 |
|
---|
[19278] | 91 | if "%target%" == "web-start" goto start
|
---|
| 92 | if "%target%" == "web-stop" goto stop
|
---|
| 93 | if "%target%" == "web-restart" goto restart
|
---|
| 94 | if "%target%" == "configure-admin" goto cfgadmin
|
---|
| 95 | if "%target%" == "configure-web" goto cfgweb
|
---|
| 96 | if "%target%" == "configure-apache" goto cfgapach
|
---|
| 97 | if "%target%" == "configure-cgi" goto cfgcgi
|
---|
[23945] | 98 | if "%target%" == "reset-gsdlhome" goto resethome
|
---|
[20262] | 99 | :: already tested gsdlhome (and web-stop-tested) above, don't want to keep looping on it
|
---|
| 100 | if "%target%" == "test-gsdlhome" goto exit
|
---|
| 101 | rem if "%target%" == "web-stop-tested" goto exit
|
---|
[20338] | 102 | rem if "%target%" == "web-status" goto status
|
---|
| 103 | rem if "%target%" == "web-graceful" goto graceful
|
---|
| 104 | if "%target%" == "set-port" goto setport
|
---|
| 105 | :: unknown command
|
---|
| 106 | echo Command unrecognised: %target%
|
---|
| 107 | goto usage
|
---|
[19278] | 108 |
|
---|
[20338] | 109 |
|
---|
[19278] | 110 | :start
|
---|
[20159] | 111 | :: START starts the app in a new console named by the string following immediately thereafter
|
---|
| 112 | :: then we start up apache-httpd and pass the signal that the stop command will respond to
|
---|
[20262] | 113 | START "%GSDLHOME%\apachectl" "%GSDLHOME%\bin\windows\starthttpd.exe" %GS2_APACHE_HTTPD_SIGNAL% "%GSDLHOME%\apache-httpd\windows\bin\httpd.exe"
|
---|
[20639] | 114 | :: if the return value is >= 0, it's succeeded:
|
---|
| 115 | if ERRORLEVEL 0 (echo %MONITOR_SUCCESS%) else (echo %MONITOR_FAILED%)
|
---|
[19970] | 116 | echo %MONITOR_FINISHED%
|
---|
| 117 | goto exit
|
---|
| 118 |
|
---|
[19278] | 119 | :stop
|
---|
[20262] | 120 | :stoptest
|
---|
[20435] | 121 | if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" "%GSDLHOME%\bin\windows\stophttpd.exe" %GS2_APACHE_HTTPD_SIGNAL% SILENT
|
---|
[20262] | 122 | if "%target%" == "web-stop-tested" goto exit
|
---|
[20639] | 123 | :: if the return value is >= 0, it's succeeded:
|
---|
| 124 | if ERRORLEVEL 0 (echo %MONITOR_SUCCESS%) else (echo %MONITOR_FAILED%)
|
---|
[20262] | 125 | echo %MONITOR_FINISHED%
|
---|
[19970] | 126 | goto exit
|
---|
| 127 |
|
---|
[20637] | 128 |
|
---|
[19278] | 129 | :restart
|
---|
[20637] | 130 | :: Need to stop server, wait and start it again.
|
---|
| 131 | :: We're using Ping to implement batch file Wait
|
---|
[20262] | 132 | if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" "%GSDLHOME%\bin\windows\stophttpd.exe" %GS2_APACHE_HTTPD_SIGNAL%
|
---|
[20637] | 133 |
|
---|
| 134 | :: Wait 5 seconds and then start. See http://ss64.com/nt/sleep.html (and http://malektips.com/dos0017.html)
|
---|
| 135 | :: if loopback IP address (127.0.0.1) does not exist, we ask them to manually start it up again
|
---|
| 136 | ping -n 1 -w 1000 127.0.0.1 |find "TTL=">nul || goto failmsg
|
---|
| 137 | echo Waiting for re-start....
|
---|
| 138 | ping -n 5 -w 1000 127.0.0.1> nul
|
---|
[19970] | 139 | goto start
|
---|
| 140 |
|
---|
[20637] | 141 | :failmsg
|
---|
| 142 | echo Unable to wait for restart. Manually run %0 web-start
|
---|
| 143 | goto exit
|
---|
| 144 |
|
---|
| 145 |
|
---|
[20338] | 146 | ::status
|
---|
| 147 | ::graceful
|
---|
| 148 | ::echo Command %target% is not operational on this operating system
|
---|
| 149 | ::goto exit
|
---|
[19278] | 150 |
|
---|
| 151 |
|
---|
| 152 | ::configure-admin
|
---|
| 153 | :cfgadmin
|
---|
| 154 | echo.
|
---|
[19288] | 155 | echo Configuring admin user password:
|
---|
| 156 | for /F %%T in ('getpw') do set encrypted_password=%%T
|
---|
[19290] | 157 |
|
---|
| 158 | :: Have to create an intermediate file in the following, because echoing
|
---|
| 159 | :: lines straight into a pipe adds spaces before the end of each line.
|
---|
[19970] | 160 | :: When piping, need to double-escape the angle brackets with three hat signs,
|
---|
[19290] | 161 | :: but when redirecting to a file, need to escape only once (one hat sign).
|
---|
[19288] | 162 | if ERRORLEVEL 0 (
|
---|
| 163 | (
|
---|
| 164 | echo [admin]
|
---|
[19290] | 165 | echo ^<enabled^>true
|
---|
| 166 | echo ^<groups^>administrator,colbuilder,all-collections-editor
|
---|
[24829] | 167 | echo ^<password^>!encrypted_password!
|
---|
[19290] | 168 | echo ^<username^>admin
|
---|
[24829] | 169 | ) > "!GSDLHOME!\etc\users.txt"
|
---|
| 170 | type "!GSDLHOME!\etc\users.txt" | txt2db -append "!GSDLHOME!\etc\users.gdb"
|
---|
| 171 | del "!GSDLHOME!\etc\users.txt"
|
---|
[19288] | 172 | ) else (
|
---|
| 173 | echo Did not set password
|
---|
| 174 | )
|
---|
[20262] | 175 | echo.
|
---|
[19288] | 176 | goto exit
|
---|
[19278] | 177 |
|
---|
[20338] | 178 |
|
---|
[23974] | 179 | :: reset-gsdlhome forces configure-cgi by renaming any
|
---|
| 180 | :: existing gsdlsite.cfg and by deleting Mac .app files
|
---|
[24297] | 181 | :: However, we only relocate if there is a gsdlsite.cfg file with its gsdlhome
|
---|
| 182 | :: property the same as the current (greenstone installation) directory
|
---|
[23945] | 183 | :resethome
|
---|
| 184 | echo.
|
---|
[24297] | 185 | if not exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" goto relocate
|
---|
[23963] | 186 |
|
---|
[24765] | 187 | set gshome=
|
---|
[24829] | 188 | FOR /F "tokens=*" %%G IN ('findstr /R ^gsdlhome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do call :concat %%G
|
---|
[24765] | 189 |
|
---|
| 190 | :: The following doesn't work if there are spaces in the gsdlhome filepath
|
---|
[24829] | 191 | ::FOR /F "tokens=2" %%G IN ('findstr /R ^gsdlhome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do set gshome=%%G
|
---|
[24300] | 192 | :: before string comparison, remove any quotes around gsdlhome value defined in config file
|
---|
[24765] | 193 | :: if not [%gshome%] == [] set gshome=%gshome:"=%
|
---|
| 194 |
|
---|
[24300] | 195 | if "%gshome%" == "%GSDLHOME%" set gshome=& goto exit
|
---|
[24297] | 196 |
|
---|
| 197 | move "%GSDLHOME%\%cgibin%\gsdlsite.cfg" "%GSDLHOME%\%cgibin%\gsdlsite.cfg.bak"
|
---|
| 198 | echo **** Regenerating %GSDLHOME%\%cgibin%\gsdlsite.cfg
|
---|
| 199 | echo **** Previous version of file now %GSDLHOME%\%cgibin%\gsdlsite.cfg.bak
|
---|
[24786] | 200 |
|
---|
| 201 | :relocate
|
---|
| 202 | :: The path to the included perl at the top of gliserver.pl needs to use the new gsdlhome
|
---|
| 203 | :: On windows, the path in gliserver.pl uses backslashes
|
---|
[24829] | 204 | for /F "delims=*" %%T in ('"echo !gshome!| !_sed! s@\\@\\\\@g"') do set safeoldhome=%%T
|
---|
| 205 | for /F "delims=*" %%T in ('"echo !gsdlhome!| !_sed! s@\\@\\\\@g"') do set safenewhome=%%T
|
---|
[24819] | 206 | if exist "%GSDLHOME%\bin\%GSDLOS%\perl" (
|
---|
[24829] | 207 | copy "!cgibin!\gliserver.pl" "!cgibin!\gliserver.pl.bak"
|
---|
| 208 | type "!cgibin!\gliserver.pl.bak" | !_sed! "s@!safeoldhome!@!safenewhome!@g" > "!cgibin!\gliserver.pl"
|
---|
| 209 | del "!cgibin!\gliserver.pl.bak"
|
---|
[24819] | 210 | )
|
---|
[24786] | 211 | set safenewhome=
|
---|
| 212 | set safeoldhome=
|
---|
[24297] | 213 | set gshome=
|
---|
| 214 |
|
---|
[24829] | 215 | for /F "delims=*" %%T in ('"echo !GSDLHOME!| !_sed! s@\\@\/@g"') do set safepath=%%T
|
---|
[23963] | 216 |
|
---|
[23974] | 217 | :: Also re-initialise the log4j.properties and force regeneration of
|
---|
| 218 | :: Mac .app files since cfgweb will generate these if they don't exist
|
---|
[23966] | 219 | type "lib\java\log4j.properties.in" | %_sed% "s\@gsdl2home@\%safepath%\g" > "lib\java\log4j.properties"
|
---|
[24006] | 220 | :: No use for Mac .app files on Windows, so they're not there in Windows binaries including caveat
|
---|
| 221 | ::for %%G in (gs2-server.app gli.app client-gli.app gems.app) do if exist "%%G\Contents\document.wflow" del "%%G\Contents\document.wflow"
|
---|
[23945] | 222 | goto cfgweb
|
---|
| 223 |
|
---|
[24765] | 224 | :: Subroutine used to glue parts of a filepath that contains spaces back together again
|
---|
| 225 | :: http://www.computing.net/answers/programming/batch-for-loop-tokens/16727.html
|
---|
| 226 | :concat
|
---|
| 227 | :: first remove any quotes around this part of the filepath
|
---|
| 228 | set suffix=%~1
|
---|
| 229 | if not "%suffix%" == "gsdlhome" set gshome=%gshome%%suffix%
|
---|
| 230 | shift
|
---|
| 231 | if not "%~1"=="" goto concat
|
---|
| 232 | goto :eof
|
---|
[23963] | 233 |
|
---|
[24765] | 234 |
|
---|
[20338] | 235 | ::configure-web
|
---|
| 236 | ::configure-cgi
|
---|
| 237 | :cfgweb
|
---|
[23974] | 238 | :: first set up Mac's .app files if that's not already been done (if this is the first time we're running GS3)
|
---|
[24006] | 239 | :: No use for Mac .app files on Windows, so they're not there in Windows binaries including caveat
|
---|
| 240 | :: for %%G in (gs2-server.app gli.app client-gli.app gems.app) do if not exist "%%G\Contents\document.wflow" type "%%G\Contents\document.wflow.in" | %_sed% "s@\*\*GSDLHOME\*\*@%safepath%@g" > "%%G\Contents\document.wflow"
|
---|
[23974] | 241 |
|
---|
[20338] | 242 | :cfgcgi
|
---|
[24295] | 243 | :: Need to preserve the user-assigned collecthome property, if any
|
---|
[23949] | 244 | if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" goto cgimsg
|
---|
| 245 | echo Configuring %cgibin%\gsdlsite.cfg
|
---|
[23987] | 246 | echo # **** This file is automatically generated, do not edit **** > "%cgibin%\gsdlsite.cfg"
|
---|
| 247 | echo # For local customization of Greenstone, edit gsdlsite.cfg.in >> "%cgibin%\gsdlsite.cfg"
|
---|
| 248 | echo. >> "%cgibin%\gsdlsite.cfg"
|
---|
[24295] | 249 |
|
---|
[24829] | 250 | for /F "delims=*" %%T in ('"echo !GSDLHOME!| !_sed! s@\\@\\\\@g"') do set safepath=%%T
|
---|
[23987] | 251 | %_sed% "s@\*\*GSDLHOME\*\*@\"%safepath%\"@g" "%cgibin%\gsdlsite.cfg.in" >> "%cgibin%\gsdlsite.cfg"
|
---|
[20338] | 252 | set safepath=
|
---|
[24295] | 253 |
|
---|
[20338] | 254 | goto cgifin
|
---|
| 255 |
|
---|
| 256 | :cgimsg
|
---|
| 257 | echo WARNING: Nothing done for configure-cgi.
|
---|
| 258 | echo If you wish to regenerate the file
|
---|
[23949] | 259 | echo %GSDLHOME%\%cgibin%\gsdlsite.cfg
|
---|
[20338] | 260 | echo from scratch, delete the existing file first.
|
---|
| 261 | echo.
|
---|
| 262 |
|
---|
| 263 | :cgifin
|
---|
| 264 | if "%target%" == "configure-cgi" goto exit
|
---|
| 265 | if "%target%" == "configure-web" goto cfgapach
|
---|
| 266 |
|
---|
| 267 | ::configure-apache
|
---|
| 268 | :cfgapach
|
---|
[24829] | 269 | if not "%configfile%" == "" if exist "%configfile%" (goto cfgport) else (echo Config file !configfile! does not exist. Using default llssite.cfg)
|
---|
[20338] | 270 |
|
---|
| 271 | if exist "%GSDLHOME%\llssite.cfg" (
|
---|
[24829] | 272 | set configfile=!GSDLHOME!\llssite.cfg
|
---|
[20338] | 273 | goto cfgport
|
---|
| 274 | )
|
---|
| 275 | if not exist "%GSDLHOME%\llssite.cfg.in" (
|
---|
[24829] | 276 | echo Unable to proceed as neither !GSDLHOME!\llssite.cfg nor !GSDLHOME!\llssite.cfg.in could be found
|
---|
[20338] | 277 | goto exit
|
---|
| 278 | )
|
---|
| 279 | copy "%GSDLHOME%\llssite.cfg.in" "%GSDLHOME%\llssite.cfg"
|
---|
[20906] | 280 | set configfile=%GSDLHOME%\llssite.cfg
|
---|
[20338] | 281 |
|
---|
| 282 | :cfgport
|
---|
| 283 | echo Configuring the apache webserver...
|
---|
| 284 | :: See http://ss64.com/nt/for_cmd.html, http://ss64.com/nt/findstr.html (and http://ss64.com/nt/find.html)
|
---|
[24829] | 285 | FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^portnumber "!configfile!"') do set port=%%G
|
---|
| 286 | FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hostIP "!configfile!"') do set hostIP=%%G
|
---|
| 287 | FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hosts "!configfile!"') do set hosts=%%G
|
---|
| 288 | FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^externalaccess "!configfile!"') do set allowfromall=%%G
|
---|
[20338] | 289 |
|
---|
[20637] | 290 | if "%allowfromall%" == "1" set allowfromall="Allow"& goto portcon
|
---|
| 291 | set allowfromall="Deny"
|
---|
[20615] | 292 |
|
---|
[20338] | 293 | :: Using CALL to jump to labels means we can return from them. BUT need to ensure
|
---|
| 294 | :: that command extensions are enabled to call labels. So just use GOTO instead.
|
---|
| 295 | ::http://ss64.com/nt/call.html
|
---|
| 296 | goto portcon
|
---|
| 297 |
|
---|
[20637] | 298 |
|
---|
[19970] | 299 | ::configure-port-and-connection
|
---|
[20338] | 300 | :setport
|
---|
[19970] | 301 | set /p port=Enter port number to use:
|
---|
[20637] | 302 | set /p hostIP=Enter host IP to allow (127.0.0.1 is included by default):
|
---|
[23252] | 303 | set /p hosts=Enter hostname or list of hosts to allow (localhost included by default):
|
---|
[20637] | 304 | set /p allowfromall=Allow external connections [yes/no]:
|
---|
[20338] | 305 |
|
---|
[20637] | 306 | if "%allowfromall%" == "yes" set allowfromall="Allow"& goto portcon
|
---|
| 307 | if "%allowfromall%" == "y" set allowfromall="Allow"& goto portcon
|
---|
| 308 | set allowfromall="Deny"
|
---|
[20615] | 309 | goto portcon
|
---|
| 310 |
|
---|
[20338] | 311 | :portcon
|
---|
| 312 | if "%port%" == "" (
|
---|
[20505] | 313 | echo Done
|
---|
| 314 | goto exit
|
---|
[20338] | 315 | )
|
---|
[24829] | 316 | if "%safepath%" == "" for /F "delims=*" %%T in ('"echo !GSDLHOME!| !_sed! s@\\@\/@g"') do set safepath=%%T
|
---|
[19970] | 317 |
|
---|
[24765] | 318 | :: Doesn't work if there are spaces in the collecthome path in gsdlsite.cfg
|
---|
[24829] | 319 | ::if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=2" %%G IN ('findstr /R ^collecthome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do set COLLECTHOME=%%G
|
---|
[24765] | 320 |
|
---|
| 321 | :: variable in subroutine concat is called gshome,
|
---|
| 322 | :: so forced to use it here for collecthome
|
---|
| 323 | set gshome=
|
---|
[24829] | 324 | if exist "%GSDLHOME%\%cgibin%\gsdlsite.cfg" FOR /F "tokens=*" %%G IN ('findstr /R ^collecthome "!GSDLHOME!\!cgibin!\gsdlsite.cfg"') do call :concat %%G
|
---|
[24765] | 325 | set COLLECTHOME=%gshome%
|
---|
| 326 | set gshome=
|
---|
| 327 |
|
---|
[22613] | 328 | if "%COLLECTHOME%" == "" set COLLECTHOME=%GSDLHOME%\collect
|
---|
[24829] | 329 | for /F "delims=*" %%T in ('"echo !COLLECTHOME!| !_sed! s@\\@\/@g"') do set safecollectpath=%%T
|
---|
[22613] | 330 |
|
---|
[20338] | 331 | echo Port: %port%
|
---|
| 332 | echo Stopping web server (if running)
|
---|
| 333 | if not exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" echo Missing conf file
|
---|
| 334 | if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" "%GSDLHOME%\bin\windows\stophttpd.exe" %GS2_APACHE_HTTPD_SIGNAL% SILENT
|
---|
| 335 | echo Setting config file to use port %port%
|
---|
[23252] | 336 | 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@\*\*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"
|
---|
[20338] | 337 | echo Type '%0 web-start' to start the web server running on port %port%
|
---|
| 338 | echo Done
|
---|
[19970] | 339 |
|
---|
[20637] | 340 | set allowfromall=
|
---|
[20338] | 341 | set _sed=
|
---|
| 342 | set safepath=
|
---|
[20637] | 343 | set port=
|
---|
[20338] | 344 |
|
---|
| 345 | :: Extra processing for configure-web and configure-cgi command targets
|
---|
[20637] | 346 | if not "%target%" == "configure-web" if not "%target%" == "configure-cgi" goto exit
|
---|
[20338] | 347 | if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" (echo %MONITOR_SUCCESS%) else (echo %MONITOR_FAILED%)
|
---|
| 348 | echo %MONITOR_FINISHED%
|
---|
| 349 | goto exit
|
---|
| 350 |
|
---|
[19278] | 351 | :exit
|
---|
[23966] | 352 | cd "%startdir%"
|
---|
| 353 | set startdir=
|
---|
[19970] | 354 | endlocal
|
---|