beautypg.com

Enabling server side includes (ssi) – Apple Mac OS X Server (version 10.2.3 or later) User Manual

Page 376

background image

376

Chapter 8

To enable a CGI for a Web site:

1

In Server Settings, click the Internet tab.

2

Click Web and choose Configure Web Service.

3

Click the Sites tab.

4

Select a Web site in the list and click Edit.

5

On the options pane, select “Enable CGI execution.”

6

Click Save, then restart Web service.

Note: Note that for security reasons, the printenv and test-cgi scripts that are pre-installed in
the /Library/WebServer/CGI-Executables folder are not executable by default. You may want
to make them executable to verify correct operation of CGIs. Use either the Finder or the
Terminal application to set their permissions to be executable.

Apple also supports CGIs written in AppleScript, referred to as ACGIs. To run an ACGI, use
the Mac OS X Script Editor to save the AppleScript as an Application with the Stay Open
option. Then start Classic and the ACGI Enabler (in /Applications/Utilities) before you
request the file from a browser. Classic is not required to run ACGIs if they are saved using
the Mac OS X version of AppleScript.

Enabling Server Side Includes (SSI)

Enabling Server Side Includes (SSI) allows a chunk of HTML code or other information to be
shared by different Web pages on your site. SSIs can also function like CGIs and execute
commands or scripts on the server.

Note: Enabling SSI requires making changes to UNIX configuration files in the Terminal
application. To enable SSI, you must be comfortable with typing UNIX commands and using
a UNIX text editor.

To enable SSI:

1

In the Terminal application, use the sudo command with a text editor to edit as the super
user (root):

/etc/httpd/httpd_macosxserver.conf

2

Add the following line to each virtual host for which you want SSI enabled:

Options Includes

To enable SSI for all virtual hosts, add the line outside any virtual host block.

3

In Server Settings, click Web and add “index.shtml” to the set of default index files for each
virtual host.

By default, the mime_macosxserver.types file maintained by Server Settings contains the
following two lines:

LL0395.Book Page 376 Wednesday, November 20, 2002 11:44 AM