beautypg.com

Enabling server side includes (ssi) – Apple Mac OS X Server (Administrator’s Guide) User Manual

Page 355

background image

Web Service

355

m If a CGI is to be used by all sites, install it in the /Library/WebServer/CGI-Executables

folder. In this case, clients must include /cgi-bin/ in the URL for the site. For example,
http://www.example.com/cgi-bin/test-cgi

m Make sure the file permissions on the CGI allow it to be executed by the user named

“www.” Since the CGI typically isn’t owned by www, the file should be executable by
everyone.

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

Select Enable CGI Execution under Site Options.

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.

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 a text editor to edit
/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.

This manual is related to the following products: