~retropikzel/fcgi-bridge

[FCGI][C][Zig]
Migrated from codeberg
Added debugging stuff
Add argument handling

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~retropikzel/fcgi-bridge
read/write
git@git.sr.ht:~retropikzel/fcgi-bridge

You can also use your local clone with git send-email.

#fcgi-bridge

Program to bridge Apache mod_fcgid to SCGI running in certain port.

#Download

Go to latest tag or release, download it and its in the dist/fcgi2-scgi. It's compiled with Zig and musl c library so that it would work on all webservers. You are of course welcome to build it yourself too.

#How to

This is only tested on hetzner web host.

Put this into the folder in .htaccess file

Options +ExecCGI
SetHandler fcgid-script
FcgidWrapper /FOLDERS_FULL_PATH/bridge.cgi .scm virtual

Put this into the folder in bridge.cgi file, dont forget to give it execution permissions (755)

#!/bin/bash

PORT=$((3000 + $RANDOM % 1000))
COMMAND_THAT_RUNS_YOUR_SCGI_SERVER_WITH_GIVEN_PORT $PORT
sleep 2
exec ./fcgi2scgi $PORT --debug

Navigate with your browser to that folder/hello.scm and you should see what your SCGI server sends. With --debug flag the fcgi2scgi exits after each request, it's made for development purposes.