http://qs321.pair.com?node_id=503391

Stephen Toney has asked for the wisdom of the Perl Monks concerning the following question:

Dear Brethren:

Since our CGI apps run on our clients' servers, we distribute them as EXEs compiled using ActiveState's PerlApp. This protects our source code.

Does anyone know if FastCGI can handle these EXEs under Windows/IIS, or is it limited to uncompiled scripts?

Are there any other solutions for Win/IIS I should be looking at to speed up CGIs?

Many thanks for any ideas/advice!

Stephen

Replies are listed 'Best First'.
Re: FastCGI and EXEs under Windows
by fizbin (Chaplain) on Oct 27, 2005 at 16:19 UTC

    There should be no reason it can't - fastcgi on IIS handles compiled C .EXE files all the time - but there may be a good reason why you can't generate proper exe files. Quoting from the CGI::Fast docs:

    In addition, you'll need a version of the Perl interpreter that has been linked with the FastCGI I/O library. Precompiled binaries are available for several platforms, including DEC Alpha, HP-UX and SPARC/Solaris, or you can rebuild Perl from source with patches provided in the FastCGI developer's kit. The FastCGI Perl interpreter can be used in place of your normal Perl without ill consequences.

    The activestate builds I've got my hands on are not linked with the FastCGI I/O library. You'll either have to find a library that does the FastCGI stuff in perl (shouldn't be /too/ hard a standard to do all in perl) or you'll have to rebuild ActivePerl with the FastCGI stuff linked in.

    Update: Never mind - you'll just need an ActiveState version of the FCGI module, and you'll have to make sure that PerlApp includes that module in the generated EXE file.
    --
    @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
      Thanks. I can see CGI::Fast in my ActiveState installation. So you think that will generate the proper EXEs? That would be terrific!

        CGI::Fast is not the same as FCGI. You'll need both modules. Fortunately, FCGI is available via ppm3. (FCGI implements the low-level bits of the fastcgi protocol; CGI::Fast implements an interface to fastcgi that looks like CGI. CGI::Fast depends on FCGI and uses it internally)

        Also, what someone else said about PerlApp with regards to recovering source code. It makes recovery of source code hard - harder than pp, so hard that it can't be done without B::Deparse tricks - but doesn't make it totally impossible.

        However, I wouldn't worry about it. Just put into your license text that says that decompiling, disassembling, or reverse engineering the source code is against the license. That's really all you can do.

        Frankly, I don't understand the extreme paranoia some people develop with regards to their source code. Maybe I don't code things that are special enough - or sell to clients shady enough - to be that paranoid about it.

        --
        @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
        Even if they do generate the proper EXE's ... those will not "protect your source code." Get a proper license and some lawyers if you are that paranoid that your code is actually worth stealing.