NAME

Math::Matlab::Server - A Matlab server as a mod_perl content handler.

SYNOPSIS

In httpd.conf ...

PerlModule Math::Matlab::Server
PerlModule Math::Matlab::Local
<Perl>
   $Math::Matlab::Server::CONFIG = {
       class => 'Math::Matlab::Local',
       args => { root_mwd => '/opt/lib/matlab-server',
                 cmd      => '/usr/local/bin/matlab -nojvm -nodisplay'
           }
   };
</Perl>

<Location /matlab-server>
   SetHandler perl-script
   PerlHandler Math::Matlab::Server
   AuthName Matlab-Server
   AuthType Basic
   AuthUserFile /opt/httpd/users
   AuthGroupFile /opt/httpd/groups
   Order Allow,Deny
   Allow from myclient.mydomain.com
   require group matlab_server
</Location>

DESCRIPTION

Math::Matlab::Server implements a mod_perl content handler which takes form input arguments named CODE, REL_MWD and RAW_OUTPUT, calls the execute() method of the server's Math::Matlab object passing the CODE and REL_MWD arguments, and sends back the results as a 'text/plain' document. The results are the value returned by the object's fetch_raw_result() or fetch_result() method, depending whether or not the RAW_OUTPUT parameter is true.

If the CODE is not given, it outputs an HTML page with a form which allows you to specify the CODE, REL_MWD and RAW_OUTPUT arguments.

Any PATH_INFO included in the URL is prepended to the REL_MWD before passing it to the execute() method.

SECURITY (OR LACK THEREOF)

PLEASE, PLEASE, PLEASE be aware that setting up such a Matlab server is opening up a HUGE security hole on your server. Anyone who can access this page can submit ANY Matlab code to it for execution. This can include shell commands. In other words, anyone who can access the page, can execute ANY command they like on your system, with the privileges of the web server user.

Even with basic authentication in place, it is very insecure. So be sure to restrict access to only trusted IP addresses and possibly run it with an SSL-enabled server.

YOU HAVE BEEN WARNED! I am not responsible for systems getting compromised by using Math::Matlab::Server.

METHODS

Public Class Methods

handler
$status = CLASS->handler( $r )

A mod_perl content handler method which implements a Matlab server.

CHANGE HISTORY

  • 10/25/02 - (RZ) Added docs.

COPYRIGHT

Copyright (c) 2002 PSERC. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Ray Zimmerman, <rz10@cornell.edu>

SEE ALSO

perl(1)