Install ikiwiki with caddy

1. The problem I’m having:

trying to install ikiwiki

it has guides for other webservers here dot cgi

cgi file does not execute, instead it downloads in web browser

2. Error messages and/or full log output:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

ikiwiki.cgi is downloaded, it does not run as cgi properly.

caddy does not generate any log entries when i click Preferences in my wiki; ikiwiki.cgi just downloads as a file

3. Caddy version:

v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=

4. How I installed and ran Caddy:

a. System environment:

Distributor ID: Ubuntu Description: Ubuntu 23.10 Release: 23.10 Codename: mantic

b. Command:

installed in apt

ps aux shows this

caddy     479728  0.9  1.2 1270472 38120 ?       Ssl  Mar16  38:23 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile

c. Service/unit/compose file:

NA

d. My complete Caddy config:

www.lecturify.net {                                           
root * /home/ikiwiki/public_html/lecturify            
file_server                                           
#reverse_proxy unix:/var/run/fcgiwrap.socket >
#       transport fastcgi {                           
#               env SCRIPT_NAME /bin/ikiwiki          
#       }                                             
#}                                                                                                          
encode zstd gzip
}

note that uncommenting does not help, behaviour is the same

5. Links to relevant resources:

https://ikiwiki.info/tips/dot_cgi/

1 Like

sorted out, by a colleague, as following

www.lecturify.net {
        root * /home/ikiwiki/public_html/lecturify
        file_server

        reverse_proxy /ikiwiki.cgi unix//var/run/fcgiwrap.socket {
                transport fastcgi {
                        root /home/ikiwiki/public_html/lecturify
                        env SCRIPT_FILENAME /home/ikiwiki/public_html/lecturify/ikiwiki.cgi
                }
        }

        encode zstd gzip
}
1 Like
  1. are you on debian 12 I see you are on ubuntu 23
  2. did you have to install any apt package related to fcgiwrap ?

I am having the same problem with caddy + ikiwiki. I am trying to get ikiwiki work on an onion URL only, (I have no domain name registered) and I have the following caddyfile:

http://mylongurl.onion {
        root * /home/user/public_html/mytestblog
        file_server

        reverse_proxy /ikiwiki.cgi unix//var/run/fcgiwrap.socket {
                transport fastcgi {
                        root /home/user/public_html/mytestblog
                        env SCRIPT_FILENAME /home/user/public_html/mytestblog/ikiwiki.cgi
                }
        }

        encode zstd gzip
        bind 127.0.0.1
}