]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/apache_cgi.mdwn
add discussion on this tip
[ikiwiki.git] / doc / tips / apache_cgi.mdwn
1 Many ikiwiki examples name the [[cgi]] "ikiwiki.cgi", and put it somewhere
2 like `~/public_html/ikiwiki.cgi`, or `/var/www/wiki/ikiwiki.cgi`.
3
4 If you follow those examples, you may find that when trying to edit a page
5 in your wiki, you see the raw contents of the ikiwiki.cgi program. Or get a
6 permission denied problem.
7
8 This is because apache is generally not configured to run cgi scripts
9 unless they're in `/usr/lib/cgi-bin/`. While you can put ikiwiki.cgi in
10 there if you like, here's how to configure apache (version 2) to run `.cgi`
11 programs from anywhere.
12
13 These instructions are for Debian systems, but the basic apache
14 configuration should work anywhere.
15
16 * Edit /etc/apache2/apache2.conf and add a line like this:
17
18         AddHandler cgi-script .cgi
19
20 * Find the "Options" line for the directory where you've put the
21   ikiwiki.cgi, and add "ExecCGI" to the list of options. For example, if
22   ikiwiki.cgi is in /var/www/, edit `/etc/apache2/sites-enabled/000-default`
23   and add it to the "Options" line in the "Directory /var/www/" stanza.
24   Or, if you've put it in a `~/public_html`, edit
25   `/etc/apache2/mods-available/userdir.conf`.