Haha, here's the vbs:
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) &
fso.GetParentFolderName(wscript.ScriptFullName) & "\perl
shell.bat"& Chr(34), 0
Set WshShell = Nothing
And I put a shortcut to this in ~/startup, Shortcut.exe (free
download) seems to work. Here's my install.bat script ;) :
@echo off
set bindir=%~dp0
set bindir=%bindir:~0,-1%
mkdir "%APPDATA%\MyPersonalHomePage"
echo ...
echo Copying application to hard drive, please be patient ....
xcopy /E /C /Y /Q "%bindir%" "%APPDATA%\MyPersonalHomePage"
echo ...
echo Creating link in startup folder
echo ...
mkdir "%APPDATA%\..\Start Menu\Programs\Startup"
Shortcut.exe /R:7 /A:C /T:"%APPDATA%\MyPersonalHomePage
\startmyphp.vbs" /F:"%AP
PDATA%\..\Start Menu\Programs\Startup\Start Personal Home Page
Server.lnk"
"%APPDATA%\MyPersonalHomePage\startmyphp.vbs"
On 27/02/2009, at 10:45 AM, Rodrigo wrote:
Stefan, I've had similar problems in windows with prefork, which can
be
started up after some tweaking, but will hang after a few requests.
Perl's
fork() is a no-no in windows. FCGI can be painful to setup, so I
ended up
giving up on it. I went on to use mod_perl with Apache, which has
problems
of its own too, but a more trivial setup. Finally, the approach I'm
using
right now is to setup a pool of single-threaded Catalyst dev servers,
starting them up in a startup.bat such as this:
start /b perl script\myapp_server.pl -p 3000
start /b perl script\myapp_server.pl -p 3001
start /b perl script\myapp_server.pl -p 3002
...
If you wish to keep all your logs in one place:
startup.bat >myapp.log 2>&1
Then setup an Apache mod_proxy load-balancer (or lighttpd's, etc.) to
balance the load among dev servers. Make sure you understand the
drawbacks
of using catalyst dev servers in this manner, even though they work
superbly.
httpd.conf (or apache2.conf or etc.):
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
<Proxy balancer://cat>
BalancerMember http://localhost:3000
BalancerMember http://localhost:3001
BalancerMember http://localhost:3002
</Proxy>
ProxyPass / balancer://cat/
ProxyPassReverse / balancer://cat/
Take a look around the web for other settings that you may need,
such as
catalyst's "using_frontend_proxy" and apache's static aliases,
balancer
features, etc. Apache is extremely lightweight if you only run it for
reverse proxy load-balancing.
If you want to startup your catalyst server pool from a windows
service
using a configuration file, I have a perl script that does that
somewhere.
Just let me know.
Hope this works for you.
--rodrigo
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/