Mailing List Archive

Catalyst in windows environment
Hi, good day. it looks like that there are plenty of good examples done on
UNIX/Linux, I just wonder anybody can share some experience with
Catalyst/Windows.

Our application is done with plain CGI/Apache/Windows/SQL Server and we want
to explore the possibility to overhaul the architecture. My main question is
when using windows server:
FastCGI or Mod-Perl? which one works and works better? any potential
problem?
Thanks.
Joe
Re: Catalyst in windows environment [ In reply to ]
On 19/06/2009, at 7:17 AM, Joseph He wrote:

> Hi, good day. it looks like that there are plenty of good examples
> done on
> UNIX/Linux, I just wonder anybody can share some experience with
> Catalyst/Windows.
>
> Our application is done with plain CGI/Apache/Windows/SQL Server and
> we want
> to explore the possibility to overhaul the architecture. My main
> question is
> when using windows server:
> FastCGI or Mod-Perl? which one works and works better? any potential
> problem?
> Thanks.
> Joe


I write single-user apps for Windows with Catalyst and deploy with the
dev server. Works OK, although windows is always more annoying than
Unix. Apache/Fastcgi should work fine, as does does SQL server (via
ODBC), I believe.


_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Catalyst in windows environment [ In reply to ]
On Thu, Jun 18, 2009 at 04:17:59PM -0500, Joseph He wrote:
> Hi, good day. it looks like that there are plenty of good examples done on
> UNIX/Linux, I just wonder anybody can share some experience with
> Catalyst/Windows.
>
> Our application is done with plain CGI/Apache/Windows/SQL Server and we want
> to explore the possibility to overhaul the architecture. My main question is
> when using windows server:
> FastCGI or Mod-Perl? which one works and works better? any potential
> problem?

One of our customers wanted IIS/MSSQL and i did it with FastCGI.
With FastCGI you're able to pick the web server you like most (or not)
and switch it afterwards without touching the application.

``Better'' is what works best for you, not someone else. And about
potential problems on windows... well, depends on your point of view.
Mine is that it just hurts, regardless of the software... but that's my
personal opinion biased by my favorite unix-like system.

Regards,
Simon

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Catalyst in windows environment [ In reply to ]
Hi,
> Hi, good day. it looks like that there are plenty of good examples done on
> UNIX/Linux, I just wonder anybody can share some experience with
> Catalyst/Windows.
>
According to my experience Catalyst works on Windows quite nice and is
stable enough even for production applications. However it is true that
the most of troubleshooting questions and answers you can find on the
Internet concern running Catalyst on UNIX (mostly Linux) platform.

> Our application is done with plain CGI/Apache/Windows/SQL Server and we want
> to explore the possibility to overhaul the architecture. My main question is
> when using windows server:
> FastCGI or Mod-Perl? which one works and works better? any potential
> problem?
>
If you are thinking about running serious Catalyst application on a
Windows box go for FastCGI - do not waste time with mod_perl
experiments. Even UNIX guys are not sure about the efficiency of running
Catalyst application under mod_perl; the other thing is that mod_perl is
Apache specific so you cannot use for example MS IIS.

Here are some issues you are very likely to run into with Catalyst on
Windows:

(1) What perl to use?

You have basically 2 options: 1) Strawberry perl -
http://strawberryperl.com 2) ActiveState perl -
http://www.activestate.com. I would recommend strawberry perl as it
supports CPAN and you can install required modules directly form there
(if you are not familiar with catalyst at the moment you will be
probably surprised how many modules Catalyst directly or indirectly
requires in its dependencies - so "cpan" command is definitely gonna
become your friend :)

After some time I have come into conclusion that for production use it
is definitely better to use perl version 5.8.9 as currently available
5.10.0 is not so stable on Win32 and have some serious bugs. For example
this one is my favourite - "broken fork":
c:\> perl -e "use namespace::clean; my $p=fork;"
this command causes perl 5.10.0 @ Win32 to crash during fork call (both
Strawberry and ActiveState) - BTW this was the reason (or at least one
of) why fork-based Catalyst::Restarter did not work well on Win32 and
was reimplemented using Proc::Background.

It is good to mention that some modules have problems with installation
via "cpan" command - namely HTTP::Server::Simple WWW::Mechanize
Class::Throwable do not pass tests (fortunately the problem is just
purely written tests; the modules works fine on Win32). Another issue is
with Catalyst::Devel and its disordered dependencies (you have to
install manually Win32::Process before Catalyst::Devel).

To sum up my recommendation:
1) download and install
http://strawberry-perl.googlecode.com/files/strawberry-perl-5.8.9.1.exe
2) from commandline run following commands
set PERL_MM_USE_DEFAULT=1
perl -MCPAN -e "notest('install', 'HTTP::Server::Simple',
'WWW::Mechanize', 'Class::Throwable');"
cpan Win32::Process Catalyst::Runtime Catalyst::Devel

(2) What webserver to use?

As mentioned before for a serious (production) application in my opinion
you have to use FastCGI. On Win32 I can recommend either Apache+FastCGI
or IIS+FastCGI. The things are however little bit tricky.

Microsoft IIS
- Catalyst works fine just with IIS6 (Windows 2003) and IIS7 (Windows
2008/Vista)
- for running on IIS7 you need currently latest Catalyst::Runtime 5.80005
- IIS5.0 (Windows 2000) and IIS5.1 (Windows XP) do support FastCGI
however not enough to run Catalyst applications
- more info you can find at
http://search.cpan.org/~mramberg/Catalyst-Runtime/lib/Catalyst/Engine/FastCGI.pm#Microsoft_IIS

Apache @ Win32
- on Windows 2000 / XP is Apache in fact the only option for running
production Catalyst application
- you might know that Apache has two modules (competitors) for FastCGI
support - mod_fastcgi and mod_fcgid
- after quite a long research I managed to run Catalyst application just
via mod_fastcgi, mod_fcgid did not work for me
- to be specific my working combination: Apache 2.2.11 + mod_fastcgi
SNAP-0811090952 (latest stable v2.4.6 does not work well on Win32)
- if you want I can put somewhere more detailed instructions and sample
configuration

My recommendation is: with Catalyst application on Win32 go with MS IIS
if you can. In theory you have also some other options like nginx for
Win32 or using Catalyst::Engine::HTTP::Prefork but those are not my
favourites.

(3) Threads - something that UNIX guys do not need to deal with

When running Catalyst application (this is not specific to Catalyst) on
Win32 it is good to know that you might run into troubles with modules
that are not thread-safe as FastCGI processes on Win23 are in fact
threads and the whole Catalyst application can behave slightly
differently than on UNIX platform. Currently I know of just one module
quite frequently used in Catalyst applications that is not thread-safe -
it is Cache::FastMmap; thus all Catalyst modules based on it (e.g.
Catalyst::Plugin::Session::Store::FastMmap) have the same problem and it
is better not to use them on Win32.

Concerning threads it is also good to keep in mind that on Win32
platform the perl call "fork" is implemented as an emulation via threads
- so even using the "fork" in your perl program/package leads into
thread-safe/unsafe problems.

--
kmx

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Re: Catalyst in windows environment [ In reply to ]
On 20 Jun 2009, at 20:50, kmx wrote:

> . Another issue is
> with Catalyst::Devel and its disordered dependencies (you have to
> install manually Win32::Process before Catalyst::Devel).

Actually, this issue is that Proc::Background's Makefile.PL is mad.

https://rt.cpan.org/Ticket/Display.html?id=47100

I'm working with the author on getting this sorted out currently :)

Cheers
t0m


_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
RE: Catalyst in windows environment [ In reply to ]
I've seen this thread a bit late, but I saw that kmx mentioned a
working setup for Apache 2.2.11 and FastCGI on Windows.

I would be very interested in seeing this, as I've recently had a lot
of problems trying to get the above working. A wiki page somewhere
detailing how to get Catalyst running on this combination would be
really useful. I'd be happy to work on this - kmx would you be able to
contact me about this (off list if you prefer as I guess it's slightly
OT here)?

Thanks, Will

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
RE: Catalyst in windows environment [ In reply to ]
Hi Will,

> I've seen this thread a bit late, but I saw that kmx mentioned a
> working setup for Apache 2.2.11 and FastCGI on Windows.
>
> I would be very interested in seeing this, as I've recently had a lot
> > of problems trying to get the above working. A wiki page somewhere
> detailing how to get Catalyst running on this combination would be
> really useful. I'd be happy to work on this - kmx would you be able
> to
> > contact me about this (off list if you prefer as I guess it's slightly
> > OT here)?

I have already created such a wiki page here:
http://dev.catalystframework.org/wiki/deployment/apache_fastcgi_win32

Another option for Windows is MS IIS - also on cat wiki:
http://dev.catalystframework.org/wiki/deployment/iis6_fastcgi
http://dev.catalystframework.org/wiki/deployment/iis7_fastcgi

--
kmx


_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Catalyst in windows environment [ In reply to ]
2009/8/7 <kmx@volny.cz>:
> Hi Will,
> I have already created such a wiki page here:
> http://dev.catalystframework.org/wiki/deployment/apache_fastcgi_win32
>
> Another option for Windows is MS IIS - also on cat wiki:
> http://dev.catalystframework.org/wiki/deployment/iis6_fastcgi
> http://dev.catalystframework.org/wiki/deployment/iis7_fastcgi

(Typically) I had just found that page about two minutes before your
email arrived! :-)

Thanks, excellent work.

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev