r1 - 06 Feb 2007 - 11:31:46 - KritsanaMunwongYou are here: NTL >  Main Web  > Winter2549_Internship > Kritsana_Deliverable > Conf-des
-- KritsanaMunwong - 06 Feb 2007

#cd /etc/htttpd/conf
#vi httpd.conf

ScriptAlias

The ScriptAlias? directive tells Apache that a particular directory is set aside for CGI programs. Apache will assume that every file in this directory is a CGI program, and will attempt to execute it, when that particular resource is requested by a client.

The ScriptAlias? directive looks like:

        ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/

Explicitly using Options to permit CGI execution

You could explicitly use the Options directive, inside your main server configuration file, to specify that CGI execution was permitted in a particular directory:

       <.Directory /usr/local/apache/htdocs/somedir.>
                Options +ExecCGI
        <./Directory.>

.htaccess files

A .htaccess file is a way to set configuration directives on a per-directory basis. When Apache serves a resource, it looks in the directory from which it is serving a file for a file called .htaccess, and, if it finds it, it will apply directives found therein. .htaccess files can be permitted with the AllowOverride? directive, which specifies what types of directives can appear in these files, or if they are not allowed at all. To permit the directive we will need for this purpose, the following configuration will be needed in your main server configuration:

AllowOverride Options

In the .htaccess file, you'll need the following directive:

Options +ExecCGI

which tells Apache that execution of CGI programs is permitted in this directory.

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by NTL
This site is powered by the TWiki collaboration platformCopyright © by National Electronics and Computer Technology Center, NECTEC.
Ideas, requests, problems regarding NTL? Send feedback