This file explains how to install and configure a web server for Maple. The general architecture is as follow. There is a web server and a remote machine on which Maple is executed (the Maple server). The communication between both servers is done by netclient.
The Perl script maple-cgi.pl must be installed on the web server. This script does nothing more than formatting and forwarding the HTTP request (either GET or POST method) to a remote Maple server through netclient. The Maple server receives the following command
cgi("httpmethod"="GET"|"POST","cgiurl"=url::string, HTML_ID[1]::string=value[1]::string, ..., HTML_ID[n]::string=value[n]::string);
quit;
This means that the Maple server must implement the function cgi, whose argument is a sequence of string=string. The left string is a HTML identifier, while the right string is its value. Note that the value is returned as a string: the function cgi should first ensure that the value does not contain any hack (such as system or rmdir) and then invoke parse. cgi outputs to STDOUT a valid HTTP response. In particular, the HTTP response must include the HTTP header, which should be one of:
In maple-cgi.pl (this is Perl language):
Example of configuration:
### WWW server $NETCLIENT = "/usr/local/bin/netclient"; $CGIURL = "http://algo.inria.fr/bin/esf"; ### Remote Maple server $MACHINE = "myhost.inria.fr"; $PORT = 2007;
> cd /usr/local/bin # mapleserver must in PATH > echo '#!/bin/bash' > mapleserver > echo 'maple -q -i /export/meunier/.mapleinit' >> mapleserver > chmod 755 mapleserver
> netserver <$PORT> 10 mapleserver error& # <$PORT> must be the same value as in maple-cgi.pl
LM, Created: 05/31/03 - Last update: 10/14/03
|
|
|