Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>mod_fcgi? I have found only mod_fastcgi and mod_fcgid. Apache configuration looks pretty simple for both. Lets compile FastCGI example and create a minimalistic Apache instance to serve it:</p> <ol> <li><p>Install libfcgi-dev</p></li> <li><p>Create temporary directory somewhere and compile the example from <a href="https://opensource.apple.com/source/FastCGI/FastCGI-4/fcgi/doc/fcgi-devel-kit.htm#S3.1" rel="nofollow noreferrer">https://opensource.apple.com/source/FastCGI/FastCGI-4/fcgi/doc/fcgi-devel-kit.htm#S3.1</a></p> <p>When you simply run it, it already has some output:</p> <pre><code>$ ./tiny-cgi Content-type: text/html &lt;title&gt;FastCGI Hello!&lt;/title&gt;&lt;h1&gt;FastCGI Hello!&lt;/h1&gt;Request number 1 running on host &lt;i&gt;(null)&lt;/i&gt; </code></pre></li> <li><p>Install apache2 and libapache2-mod-fcgid; create configuration file apache.conf:</p> <pre><code>User www-data Listen 8080 PidFile apache.pid DocumentRoot . LoadModule fcgid_module /usr/lib/apache2/modules/mod_fcgid.so SetHandler fcgid-script Options +ExecCGI ErrorLog error.log </code></pre> <p>User www-data is important, because it has access to <code>/var/lib/apache2/fcgid/sock/</code>, which is pretty important for fcgid (I am running on Debian, maybe somewhere else it will be different). Having DocumentRoot in the same directory with the rest is not very good, but this is just a quick example.</p></li> <li><p>Run <code>sudo /usr/sbin/apache2 -d . -f apache.conf -X</code></p> <p>That <code>-X</code> is for debug mode, when the server does not daemonize (does not detach), which is pretty handy for such playing.</p></li> <li><p>Go to <code>http://localhost:8080/tiny-cgi</code>, where you will see output from your FastCGI program. If not, see <code>error.log</code>.</p></li> <li><p>Stop Apache, install libapache2-mod-fastcgi, replace the two lines in configuration with:</p> <pre><code>LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so SetHandler fastcgi-script </code></pre></li> <li><p>Visit <code>http://localhost:8080/tiny-cgi</code> again.</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload