User manual

Table Of Contents
Chapter 3 Managing Websites 33
Enabling a Common Gateway Interface (CGI) Script
Common Gateway Interface (CGI) scripts (or programs) send information back and
forth between your website and applications that provide different services for the site.
If a CGI is to be used by only one site, install the CGI in the Documents folder for the
site. The CGI name must end with the suffix “.cgi.”
If a CGI is to be used by all sites on the server, 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.
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 website:
1 In Server Admin, click Web in the list for the server you want.
2 Click Settings in the button bar.
3 In the Sites pane, double-click the site in the list.
4 In the Options pane, select CGI Execution.
5 Click Save.
Web service restarts.
Enabling Server Side Includes (SSI)
Enabling Server Side Includes (SSI) allows a chunk of HTML code or other information
to be shared by different webpages 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):
2 Add the following line to each virtual host for which you want SSI enabled:
Options Includes
Each site is in a separate file in /etc/httpd/sites/.
To enable SSI for all virtual hosts, add the line outside any virtual host block.
3 In Server Admin for the server you want, click Settings in the button bar.
4 In the Sites pane, double-click one of the virtual host sites.
LL2350.book Page 33 Friday, August 22, 2003 2:32 PM