Changeset 20637 for gsdl/trunk
- Timestamp:
- 2009-09-18T18:41:06+12:00 (15 years ago)
- Location:
- gsdl/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/gsicontrol.bat
r20615 r20637 39 39 echo configure-apache [config-filename] 40 40 echo configure-cgi 41 echo set-port 41 42 echo test-gsdlhome 42 43 echo web-stop-tested … … 102 103 goto exit 103 104 105 104 106 :restart 107 :: Need to stop server, wait and start it again. 108 :: We're using Ping to implement batch file Wait 105 109 if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" "%GSDLHOME%\bin\windows\stophttpd.exe" %GS2_APACHE_HTTPD_SIGNAL% 106 :: wait 4s, see http://malektips.com/dos0017.html. The number in the 2nd line is variable (number of seconds to wait) 107 ping 127.0.0.1 -n 2 -w 1000 > nul 108 ping 127.0.0.1 -n 4 -w 1000> nul 109 ::"%GSDLHOME%\bin\windows\starthttpd.exe" %GS2_APACHE_HTTPD_SIGNAL% "%GSDLHOME%\apache-httpd\windows\bin\httpd.exe" 110 111 :: Wait 5 seconds and then start. See http://ss64.com/nt/sleep.html (and http://malektips.com/dos0017.html) 112 :: if loopback IP address (127.0.0.1) does not exist, we ask them to manually start it up again 113 ping -n 1 -w 1000 127.0.0.1 |find "TTL=">nul || goto failmsg 114 echo Waiting for re-start.... 115 ping -n 5 -w 1000 127.0.0.1> nul 110 116 goto start 117 118 :failmsg 119 echo Unable to wait for restart. Manually run %0 web-start 120 goto exit 121 111 122 112 123 ::status … … 184 195 :: See http://ss64.com/nt/for_cmd.html, http://ss64.com/nt/findstr.html (and http://ss64.com/nt/find.html) 185 196 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^portnumber %configfile%') do set port=%%G 186 echo Found port %port% 187 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^externalaccess %configfile%') do set connect=%%G188 189 if "% connect%" == "1" set allowfrom="all"& goto portcon190 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^host %configfile%') do set allowfrom=%%G 197 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^hostIP %configfile%') do set hostIP=%%G 198 FOR /F "tokens=2 delims==" %%G IN ('findstr /R ^externalaccess %configfile%') do set allowfromall=%%G 199 200 if "%allowfromall%" == "1" set allowfromall="Allow"& goto portcon 201 set allowfromall="Deny" 191 202 192 203 :: Using CALL to jump to labels means we can return from them. BUT need to ensure … … 195 206 goto portcon 196 207 208 197 209 ::configure-port-and-connection 198 210 :setport 199 211 set /p port=Enter port number to use: 200 set /p connect=Allow external connections [yes/no]: 201 if "%connect%" == "yes" set allowfrom="all"& goto portcon 202 if "%connect%" == "y" set allowfrom="all"& goto portcon 203 204 set /p allowfrom=Enter host (hostname, IP, localhost, 127.0.0.1) to use: 212 set /p hostIP=Enter host IP to allow (127.0.0.1 is included by default): 213 set /p allowfromall=Allow external connections [yes/no]: 214 215 if "%allowfromall%" == "yes" set allowfromall="Allow"& goto portcon 216 if "%allowfromall%" == "y" set allowfromall="Allow"& goto portcon 217 set allowfromall="Deny" 205 218 goto portcon 206 219 … … 218 231 if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" "%GSDLHOME%\bin\windows\stophttpd.exe" %GS2_APACHE_HTTPD_SIGNAL% SILENT 219 232 echo Setting config file to use port %port% 220 type "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf.in" | %_sed% "s@\*\*PORT\*\*@%port%@g" | %_sed% "s@\*\*CONNECT ION\*\*@%allowfrom%@g" | %_sed% "s@\*\*GSDLHOME\*\*@%safepath%@g" | %_sed% "s@\*\*APACHE_HOME_OS\*\*@%safepath%\/apache-httpd\/%GSDLOS%@g" > "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf"233 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@\*\*GSDLHOME\*\*@%safepath%@g" | %_sed% "s@\*\*APACHE_HOME_OS\*\*@%safepath%\/apache-httpd\/%GSDLOS%@g" > "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" 221 234 echo Type '%0 web-start' to start the web server running on port %port% 222 235 echo Done 223 236 224 set connect= 225 set allowfrom= 237 set allowfromall= 226 238 set _sed= 227 239 set safepath= 240 set port= 228 241 229 242 :: Extra processing for configure-web and configure-cgi command targets 230 if not "%target%" == "cfgweb" goto exit 231 if not "%target%" == "cfgcgi" goto exit 243 if not "%target%" == "configure-web" if not "%target%" == "configure-cgi" goto exit 232 244 if exist "%GSDLHOME%\apache-httpd\%GSDLOS%\conf\httpd.conf" (echo %MONITOR_SUCCESS%) else (echo %MONITOR_FAILED%) 233 245 echo %MONITOR_FINISHED% 234 set port=235 set externalaccess=236 246 goto exit 237 247 -
gsdl/trunk/gsicontrol.sh
r20622 r20637 162 162 # This version runs without testing for GSDLHOME 163 163 # Useful to be run as a target when we know test-gsdlhome has already 164 # been done. This avoids a unnecessary repetition of printing164 # been done. This avoids an unnecessary repetition of printing 165 165 # out the values of GSDLHOME and GSDLOS 166 166 if test -e "$GSDLHOME/apache-httpd/$GSDLOS/conf/httpd.conf" ; then
Note:
See TracChangeset
for help on using the changeset viewer.