2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_cgid.xml.meta">
26 <description>Execution of CGI scripts using an
27 external CGI daemon</description>
29 <sourcefile>mod_cgid.c</sourcefile>
30 <identifier>cgid_module</identifier>
31 <compatibility>Unix threaded MPMs only</compatibility>
34 <p>Except for the optimizations and the additional <directive
35 module="mod_cgid">ScriptSock</directive> directive noted below,
36 <module>mod_cgid</module> behaves similarly to <module>mod_cgi</module>.
37 <strong>See the <module>mod_cgi</module> summary for additional details
38 about Apache and CGI.</strong></p>
40 <p>On certain unix operating systems, forking a process from a
41 multi-threaded server is a very expensive operation because the
42 new process will replicate all the threads of the parent
43 process. In order to avoid incurring this expense on each CGI
44 invocation, <module>mod_cgid</module> creates an external daemon that is
45 responsible for forking child processes to run CGI scripts. The
46 main server communicates with this daemon using a unix domain
49 <p>This module is used by default instead of
50 <module>mod_cgi</module> whenever a multi-threaded MPM
51 is selected during the compilation process. At the user level,
52 this module is identical in configuration and operation to
53 <module>mod_cgi</module>. The only exception is the
54 additional directive <code>ScriptSock</code> which gives the
55 name of the socket to use for communication with the cgi
59 <seealso><module>mod_cgi</module></seealso>
60 <seealso><a href="../suexec.html">Running CGI programs under different
61 user IDs</a></seealso>
63 <directivesynopsis location="mod_cgi">
64 <name>ScriptLog</name>
67 <directivesynopsis location="mod_cgi">
68 <name>ScriptLogLength</name>
71 <directivesynopsis location="mod_cgi">
72 <name>ScriptLogBuffer</name>
76 <name>ScriptSock</name>
77 <description>The filename prefix of the socket to use for communication with
78 the cgi daemon</description>
79 <syntax>ScriptSock <var>file-path</var></syntax>
80 <default>ScriptSock cgisock</default>
81 <contextlist><context>server config</context></contextlist>
84 <p>This directive sets the filename prefix of the socket to use for
85 communication with the CGI daemon, an extension corresponding to
86 the process ID of the server will be appended. The socket will be opened
87 using the permissions of the user who starts Apache (usually
88 root). To maintain the security of communications with CGI
89 scripts, it is important that no other user has permission to
90 write in the directory where the socket is located.</p>
92 <p>If <var>file-path</var> is not an absolute path, the location specified
93 will be relative to the value of
94 <directive module="core">DefaultRuntimeDir</directive>.</p>
96 <example><title>Example</title>
97 <highlight language="config">
98 ScriptSock /var/run/cgid.sock