The following steps describe how to install a server which uses a Math::Matlab::Local object for computations.
PerlModule Math::Matlab::Server
PerlModule Math::Matlab::Local
<Perl>
$Math::Matlab::Server::CONFIG = {
class => 'Math::Matlab::Local',
args => { root_mwd => 'ROOT_MWD',
cmd => 'MATLAB_EXE'
}
};
</Perl>
<Location BASE_URL>
SetHandler perl-script
PerlHandler Math::Matlab::Server
AuthName Matlab-Server
AuthType Basic
Order Allow,Deny
Allow from MY_IPs
AuthUserFile USER_FILE
AuthGroupFile GROUP_FILE
Order Allow,Deny
require group GROUP
</Location>
The following strings between #-# should be replaced by actually values, such as:
ROOT_MWD /etc/httpd/matlab-server MATLAB_EXE /usr/local/bin/matlab -nojvm -nodisplay
BASE_URL /matlab-server
MY_IPs myclient.mydomain.com
USER_FILE /etc/httpd/users
GROUP_FILE /etc/httpd/groups
GROUP matlab_server
7. Copy the server test files to the root_mwd of the server.
e.g. cp -r server/* /etc/httpd/matlab-server
8. Start the server.
Note: $Math::Matlab::Server::CONFIG can specify any sub-class of Math::Matlab along with the arguments needed by the constructor and the server will use this Math::Matlab object to perform the calculations. E.g. you could have a configuration with several servers set up with Math::Matlab::Local objects and one with a Math::Matlab::Pool which contains a Local and Remote's which point to the other servers. This is one way of implementing a pool of servers.