MML Documentation

Installation

Requirements

MML is a CGI script, so requires a server which supports CGI at least enough that it can pass correct parameters to the script. It is known to work on Apache, as well as Microsoft's IIS and PWS servers.

MML also requires Perl 5. This is usually included with most distributions of unix-like systems, and can be obtained for Win32 from ActiveState.

MML makes use of the fork() system call when executing embedded code blocks. Most Windows versions of perl do not support this, or support it badly, so code blocks might not be functional on win32 versions of perl. Apparently, recent versions of ActiveState perl emulate fork calls successfully, but my tests didn't seem to confirm this. If it works for you, all well and good...

To make use of MML on a server which isn't yours, but you have space available to you, you will need to be able to install and run CGI scripts, as well as be able to use .htaccess to set some things up. Most free webspace servers don't allow you to do either of these things, and the latter is sometimes not even available to those who pay for their space. Basically, it will be a lot easier to do this if you are the administrator for the server you want to use it on.

Installation

Installation is relatively painless for both Apache and IIS/PWS.

Apache

Firstly, you will need to place the file mml-ng.cgi somewhere where it can be executed. This can either be a ScriptAlias directory (such as cgi-bin) or a directory with Options +ExecCGI set. It will be assumed for the remainder of these instructions that you placed it in /cgi-bin so remember to substitute where you did install it if you choose to put it elsewhere.

Next, the following two directives need to be added to the configuration either in the global server configuration, or in the configuration for a particular directory (such as .htaccess):

AddType text/martml .mml
Action text/martml /cgi-bin/mml-processor.cgi

You may also wish to add index.mml to the DirectoryIndex directive so that this filename can be used when no filename is specified in a URL.

If you are using a filesystem with permissions (ext2, ntfs etc) remember to make the mml-processor.cgi file readable and executable by all.

Microsoft IIS/PWS

For IIS and PWS, you can put the mml-ng.cgi file anywhere in the filesystem you like, preferably outside the directories accessible to the server. The settings for Script Mappings are stored in the registry, and can be added with the following registry script:

REGEDIT4

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Script Map]
".mml"="c:\\perl\\bin\\perl.exe c:\\inetpub\\mml-ng.cgi %s"

You will need to copy these three lines to a text editor (such as notepad) and edit the paths to both perl.exe and mml-ng.cgi to where you have them installed, making sure to use two backslashes whenever they would normally be one.

Save this file with a .reg extension rather than a .txt extension, and then right-click the icon for the file you just created and choose 'Merge'. The Registry Editor should inform you that the information was successfully entered into the registry, and after restarting your server you should find that files ending in the .mml extension go though the processor. At this stage, MML isn't configured, so .mml files will produce errors or blank documents.

Other Servers

Other servers should be relatively similar to configure, so long as they support the method of envoking scripts that MML uses. The script filename must be passed in the PATH_INFO and PATH_TRANSLATED variables for it to work. Please consult the documentation for your server for details on installation of scripts and mapping files to execute through them.

Initial Configuration

MML stores most of its settings in external files, but one setting is found in the script itself, and that is where the settings files can be found. You need to create a directory where the MML configuration files reside. I recommend you put this outside the directories accessible from the web, perhaps in /etc/httpd/conf/mml on unix and c:\inetpub\mml on Win32.

Once you've created this directory, the file mml-ng.cgi must be edited slightly. The line in question is the following:

$confdir="/etc/httpd/conf/mml/";

Carefully edit the path between the quotes. Note that forward slashes must be used, even on Win32 systems where the backslash is more usual. Also, remember that trailing slash.

Now you need to create a mml.conf file in the directory you created and specified. An example mml.conf is included, but this just exists to show you how the settings work and so for now you'll probably want to leave the file blank.

The rest of the setup stuff is in the first part of the Usage section, so continue on from there :)