Sun Java System Web Server 6.1 SP12 Programmer's Guide

Enabling Server-side HTML

The server parses server-side tags only if server-side parsing is enabled.

ProcedureTo enable server-side parsing using the Administration interface

  1. Access the Class Manager, and then click on the Content Management tab.

  2. Click the Parse HTML link.

  3. Use the drop-down list to specify a resource for which the server will parse HTML.

    Choose the virtual server or a specific directory within the virtual server. If you choose a directory, the server will parse HTML only when the server receives a URL for that directory or any file in that directory.

  4. Choose whether to activate server-parsed HTML. The choices are:

    • No. The server does not parse HTML.

      • Yes, with exec tag. The server parses HTML and allows HTML files to execute arbitrary programs on the server.

      • Yes, without exec tag. The server parses HTML but does not allow HTML files to execute arbitrary programs on the server. You might not want to allow the exec tag for security or performance reasons.

  5. Choose which files to parse. The choices are:

    • Files with the extension .shtml. The server parses only files with the extension .shtml. In this case, all files you want to parse must have the .shtml extension. This is the most common (and default) choice.

      • Files with the execute bit and the extension .shtml. (Unix/Linux only) The server parses files whose UNIX/Linux permissions specify that the execute bit is on. Using the execute permissions can be unreliable because in some cases the bit is set on files that are not executable.

      • All HTML files. The server parses all HTML files. Choosing this option can slow down server performance.

  6. Click OK, and then apply your changes.

    When you activate parsing, ensure that the following directives are added to the magnus.conf file :

    Note –

    native threads are turned off

    Init funcs="shtml_init,shtml_send" 
    shlib="install_dir/bin/https/bin/Shtml.dll" NativeThreads="no"

    Note that you must set NativeThread="no" for Sun Java System Web Server version 6.1 and above. In addition, these functions now originate from Shtml.dll (or on UNIX), which is located in install_dir/bin/https/bin for Windows, and install_dir/bin/https/lib for UNIX.

    In addition, make sure the following directive is added to the obj.conf file:

    <Object name="default">
    Service fn="shtml_send" type="magnus-internal/parsed-html" 

    To enable parsing of server-side tags for files with extensions other than .shtml, add the extension to the appropriate line in the mime.types file. For example, the following line in mime.types indicates that files with either an .shtml or .jbhtml extension are parsed for server-side tags:

    type=magnus-internal/parsed-html exts=shtml,jbhtml