Matlab Web Server Installation and Configuration Guide

1. Introduction 2

2. Product Requirements 2

2.1 Web Requirements 2

2.1.1 Web Browser 2

2.1.2 Web Server 2

3. Configuration 2

3.1 Matlab Web Server Installation 2

3.2 Matlab Web Server Setup 3

3.2.1 Matweb.conf 3

3.2.2 Matlabserver.conf 3

3.3 Apache Installation 4

3.4 Apache Setup 4

4. Additional Configuration 5

4.1 PHP Installation 5

4.2 PHP Setup 5

5. Tested program versions 6

6. References 6

1.  Introduction

This guide covers installation of Matlab Web Server on IBM PC compatible computers running Microsoft Windows NT.

2.  Product Requirements

The Matlab Web Server has the same supporting hardware and software requirements as Matlab itself, except for memory required. Look in the Matlab Installation Guide[1] for hardware and software requirements.

Memory requirements while running the Matlab Web Server vary with the number of Matlabs configured. Each Matlab running under the Matlab Web Server consumes 256 KB of memory.

The Matlab Web Server requires Matlab Release 11 or later and that TCP/IP networking software must be installed on the computer.

2.1  Web Requirements

2.1.1  Web Browser

A Web browser suitable for your platform must be installed to submit input and receive output from the Matlab Web Server. Netscape Communicator Release 4.7 and Microsoft Internet Explorer 5.0 have been tested with current Matlab Web Server.

2.1.2  Web Server

Web server software (HTTPD or similar) capable of running Common Gateway Interface (CGI) need to be installed on the system where Matlab is running or on a machine that has network access to the machine where Matlab is running.

The free software used in this configuration is the Apache web server [2].

3.  Configuration

This part describes how to setup and configure the Matlab Web Server on Windows NT, and how to configure it with Apache web server.

3.1  Matlab Web Server Installation

Note When installing Matlab Web Server and Apache make sure that the directories where the software are installed DON’T INCLUDE ANY SPACES IN THE PATH NAMES.

Follow the normal Matlab installation procedure for your platform, as documented in

Matlab Installation Guide to install the Matlab Web Server. Select the Matlab Web Server choice when it appears during the installation.

Before it is possible to run Matlab Web Server applications a web server, such as Apache, need to be installed and configured. This web server will regulate communication between Matlab and the web browser (Netscape or Explorer).

3.2  Matlab Web Server Setup

Note The notation <matlab> represent the Matlab root directory, the directory where Matlab is installed on the system.

3.2.1  Matweb.conf

The file matweb.conf is the Matlab Web Server configuration file. It is by default located in the <Matlab>/toolbox/webserver/wsdemos directory. Open the file in a text editor and replace the notation <matlab> with the name of the root directory where Matlab is installed.

If an application creates graphic files, there must be provided for a location where Matlab can write these for Apache server access, e.g /icons (see Apache Setup). Applications are delineated by the main application entry point name (M-file) in square brackets []. The mldir entry associated with each application in the matweb.conf file indicates the location to Matlab.

[testfile]

Mldir= <Matlab>/toolbox/webserver/wsdemos

Also, replace matlabserver_host_name with the TCP/IP hostname of the machine. If the Matlab Web Server is installed locally the hostname should be localhost (or 127.0.0.1).

Mlserver=localhost

3.2.2  Matlabserver.conf

The installation procedure creates the file matlabserver.conf. The file is by default located in <Matlab>/webserver/matlabserver.conf. The file contains the notation:

-m 1

This number represents the number of Matlabs that can run concurrently. After testing that everything is working properly, you can change this number to something more convenient. To see any changes made to matlabserver.conf, the Matlab Web Server must be stopped and restarted.

3.3  Apache Installation

Download the most recent version of Apache for Windows on:

http://httpd.apache.org/dist/httpd/binaries/win32/

Download the file named apache_1.3.22-win32_nosrc-r2.msi or similar.

To install msi package it is required that Microsoft Installer is present. If it is not installed on the computer, download it from http://httpd.apache.org/dist/httpd/binaries/win32/

and install it.

It is recommended that Apache is installed as a service, in this way it will automatically start when the machine boots and keep it running when logging off.

3.4  Apache Setup

Before it is possible to use Matlab Web Server with Apache some smaller changes are needed to the Apache configuration file called httpd.conf. The location of the file is in the conf folder under the path selected for installation.

Open the file in a text editor and make the following changes in the file.

Change the “DocumentRoot” directory to your Matlab Web Server directory

DocumentRoot “<Matlab>/toolbox/webserver/wsdemos”

Change the “Directory” to whatever the “DocumentRoot” is set to:

<Directory “<Matlab>/toolbox/webserver/wsdemos”>

The Matlab Web Server examples that follow the product will try to show all images in the <Matlab>/toolbox/webserver/wsdemos directory. The examples html-files calls the alias /icons/ directory. To be able to see the images in the web browser, an alias for the /icons/ directory is needed. Change that line to:

Alias /icons/ “<Matlab>/toolbox/webserver/wsdemos”

Also change the directory to:

<Directory “<Matlab>/toolbox/webserver/wsdemos”>

Finally, change the script alias directory. This controls which directories that contain server scripts. Change the line:

ScriptAlias /cgi-bin/ “<Matlab>/toolbox/webserver/wsdemos”

Also change the directory to:

<Directory “<Matlab>/toolbox/webserver/wsdemos”>

Now it is necessary to restart the Apache Web Server.

4.  Additional Configuration

4.1  PHP Installation

A PHP installation is needed if PHP-script is used in the Matlab Web Server applications (e.g in the HTML code).

Download the most recent version of PHP for Windows on:

http://www.php.net

Extract the distribution file to a directory.

4.2  PHP Setup

This part explains how to set up PHP in order to use Apache module dll.

It is needed to ensure that the dlls that PHP uses can be found. The precise dlls involved depend on the web server in use and if PHP is running as a CGI or as a server module. Php4ts.dll is always needed. Relevant DLL from the sapi folder is also needed. If any PHP extension DLLs are used then they are needed as well. To make sure that the DLLs can be found, copy them to the system directory (e.g winnt/systm32).

Copy php4ts.dll and all all .dll-files under the dll folder to winnt/system32

There are two ini-files, php.ini-dist and php.ini-recommended, distributed with the PHP installation. The latter is recommended.

Copy php.ini-recommended to the system directory (e.g winnt) and rename it to php.ini.

Edit the new php.ini file. Set the root of the PHP pages to:

Doc_root=”<Matlab>/toolbox/webserver/wsdemos”

Also change the ‘extension_dir’ setting to point to where the ‘php_*.dll’ files are placed:

Extension_dir = “C:/php/extensions”

A few changes are required in the Apache configuration file:

LoadModule php4_module c:/php/sapi/php4apache.dll

AddType application/x-httpd-php .php .phtml

In Apache 1.3.22 for Windows, the Apache default configuration file has a ClearModuleList directive included by default. If this directive is used, it is required to put an AddModule mod_php4.c to the AddModule list, as else PHP will not be registered as an Apache module.

AddModule mod_php4.c

5.  Tested program versions

Matlab Web Server 6.1

Matlab R12

Apache 1.3.22-win32

PHP 4.1.1-win32

Microsoft Internet Explorer 5.5

6.  References

[1] Matlab Installation Guide

[2] www.apache.org

[3] www.php.net

REVISION

Rev. ind. / Page (P)
Chapt. (C) / Description / Date
Dept./Init.
/ Doc. no. / Lang. / Rev. ind. / Page
ABB Process Industries / en / 7