Novell LINUX ENTERPRISE SERVER 11 - ADMINISTRATION Administration Manual page 413

Hide thumbs Also See for LINUX ENTERPRISE SERVER 11 - ADMINISTRATION:
Table of Contents

Advertisement

27.5.1 Apache Configuration
In SUSE Linux Enterprise Server, the execution of CGI scripts is only allowed in the
directory /srv/www/cgi-bin/. This location is already configured to execute CGI
scripts. If you have created a virtual host configuration (see
Configuration"
(page 376)) and want to place your scripts in a host-specific directory,
you must unlock and configure this directory.
Example 27.5 VirtualHost CGI Configuration
ScriptAlias /cgi-bin/ "/srv/www/www.example.com/cgi-bin/"
<Directory "/srv/www/www.example.com/cgi-bin/">
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Order allow,deny
Allow from all
</Directory>
Tells Apache to handle all files within this directory as CGI scripts.
Enables CGI script execution
Tells the server to treat files with the extensions .pl and .cgi as CGI scripts. Adjust
according to your needs.
The Order and Allow directives control the default access state and the order
in which Allow and Deny directives are evaluated. In this case "deny" statements
are evaluated before "allow" statements and universal access is enabled.
27.5.2 Running an Example Script
CGI programming differs from "regular" programming in that the CGI programs and
scripts must be preceded by a MIME-Type header such as Content-type:
text/html. This header is sent to the client, so it understands what kind of content
it receives. Secondly, the script's output must be something the client, usually a Web
browser, understands—HTML in most cases or plain text or images, for example.
A simple test script available under /usr/share/doc/packages/apache2/
test-cgi is part of the Apache package. It outputs the content of some environment
variables as plain text. Copy this script to either /srv/www/cgi-bin/ or the script
Section "Virtual Host
The Apache HTTP Server
399

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 11

Table of Contents