|MATLAB Web Server|
When we viewed the source of the
webmagic1.html file, we observed the line of HTML code
and we noted that this line establishes communication with MATLAB.
matweb is a program that resides on the HTTP server and communicates with
matweb requires information found in
matweb.conf to locate
matlabserver (which could be running on a different machine).
matweb is a client of
matlabserver that uses Common Gateway Interface (CGI) to get data from HTML forms. It transfers the information to
matlabserver, which then runs applications written in M-files to produce responses.
When the MATLAB Web Server is installed,
matweb is placed in
arch for all architectures. This placement allows you to run
matweb on a machine having the HTTPD
For HTTP server access you must also place a copy of
matweb in the directory denoted by the
/cgi-bin alias. The installation process places a copy in
<matlab>/toolbox/webserver/wsdemos to run the sample applications.
To connect with
matweb requires information stored in the configuration file
matweb.conf. Create this file inside the directory denoted by
/cgi-bin, along with the
matweb program. Use the copy in
<matlab>/toolbox/webserver/wsdemos as a guide.
An instance of
matweb.conf looks like
Multiple application configurations must appear in the same file. Each variable appears on a separate line followed by an equal sign
=, which is then followed by a value, e.g.,
mlserver=parrot. Applications are delineated by the main application entry point name (M-file) in square brackets
. For example,
[webpeaks] is on one line followed by all its variables and corresponding values. Note that
webmagic does not require an
mldir entry because it does not generate any graphics or save any files. Use the
# character at the beginning of any line to comment it out.
All the fields that can be contained in
matweb.conf are described in Table 3-2.
||Name of the MATLAB application to run
||Produces an application-specific log file that records all exchanges between the application and MATLAB. Turn off logging when the program is running because logging has a negative impact on performance.
||Seconds to wait for
||User-created configuration variable
After you create a new MATLAB Web Server application and enter its configuration data into
matweb.conf, you need to restart
matlabserver before you can use the application.
Looking again at the source from the
webmagic1.html file (see webmagic Input), observe that the line
mlmfile to the value
mlmfile argument contains the name of the MATLAB M-file to run.
matlabserver uses the value of
mlmfile obtained from the
webmagic in this example) to run the MATLAB application.
webmagic takes the input data from
webmagic1.html, computes the magic square of the requested dimensions, and outputs the results using
webmagic2.html as a template.
|matlabserver.conf||Returning Results via the Web|