Awkiawki with slowcgi with NGINX on FreeBSD
How to run awkiawki using slogcgi and NGNINX
Awkiawki is a wiki written in awk.
slowcgi is a server which implements the FastCGI Protocol to execute CGI scripts. slowcgi is a simple server that translates FastCGI requests to the CGI protocol. It executes the requested CGI script and translates its output back to the FastCGI protocol.
slowcgi is on FreeBSD available as package.
I run this from /home/www.
Configuring slowcgi
Add the following lines to /etc/rc.conf:
slowcgi_enable="YES"
slowcgi_flags="-p /home/www -s /home/www/run/slowcgi.sock"
Start slowcgi. It will open a socket in /home/www/run/slowcgi.sock.
Chroot
Slowcgi lets the scripts run in a chroot directory.
Make sure the needed executables (like mawk for awkiawki) are in a path
within the chroot directory, and that all the needed libraries are there too.
Configuring NGINX to use slowcgi
server {
listen 80;
server_name wiki.example.com;
root "/home/www/";
location /cgi-bin/ {
index index.cgi;
fastcgi_pass unix:/home/www/run/slowcgi.sock;
fastcgi_index index.cgi;
include fastcgi_params;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_split_path_info ^(.+\.cgi)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME "/cgi-bin/wiki/index.cgi";
proxy_set_header Host $host;
}
}
We set a fastcgi_pass to the socket.
The fastcgi_split_path_info fetches the path_info from the request URL.
Debugging
It helps to manually start slowcgi with the -v flag:
slowcgi -d -v -p /home/www/ -s /home/www/run/slowcgi.sock
When everything is fine, start slowcgi normally.
Webrings
100% made with ♥ by a human — no cookies, no trackers.
Proud member of the 250kb.club,
the no-JS.club,
the Blogroll.Club,
and the Bukmark.Club.
Don’t let a billionaire’s algorithm control what you read — use an RSS feed reader.
Most recent pages All tags Sitemap RSS of Gophersite
