= Fcgiwrap = '''`fcgiwrap(8)`''' is a simple wrapper script around a [[Protocols/CGI|FastCGI]] implementation. It comes from the [[Lighttpd]] project. <> ---- == Installation == Most [[Linux]] distributions offer a `fcgiwrap` package. Consider also installing `spawn-fcgi`. ---- == Setup == [[Linux/Systemd|Enable and start]] `fcgiwrap.socket`. ---- == Usage == === Nginx === See [[Nginx/FastCGI#Fcgiwrap|here]] for details. Upstream recommends using `spawn-fcgi(1)`, rather than `fcgiwrap(8)` directly. With it, no configuration is necessary and the server can be started like: {{{ spawn-fcgi -n -u www-data -p 9000 -- /usr/bin/fcgiwrap -f }}} Similarly, if using a container to serve a FastCGI server, try: {{{ FROM alpine:latest RUN apk add spawn-fcgi fcgiwrap COPY myapp /myapp EXPOSE 9000 WORKDIR /myapp CMD spawn-fcgi -n -p 9000 -- /usr/bin/fcgiwrap -f }}} See [[Nginx/FastCGI#Spawn-fcgi|here]] for details. === Path_Info === Upstream has noted that `fcgiwrap(8)` was written before [[Nginx]] offered `fastcgi_split_path_info`. "`PATH_INFO` passed from the web server is ignored and instead is parsed out of `SCRIPT_FILENAME` (or `DOCUMENT_ROOT` + `SCRIPT_NAME`)." So, the solution is to... 1. set these variables directly 2. copy `fastcgi_params` to `fcgiwrap_params` and comment out the lines that set `DOCUMENT_ROOT` and `SCRIPT_NAME`. {{{ include fcgiwrap_params; fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend; #or fastcgi_param DOCUMENT_ROOT /usr/libexec/git-core/ fastcgi_param SCRIPT_NAME git-http-backend }}} ---- CategoryRicottone