{"id":17861120,"url":"https://github.com/jonathanstowe/raku-fastcgi-nativecall","last_synced_at":"2025-03-20T21:31:10.080Z","repository":{"id":46314617,"uuid":"79846341","full_name":"jonathanstowe/raku-fastcgi-nativecall","owner":"jonathanstowe","description":"An implementation of FastCGI using NativeCall","archived":false,"fork":false,"pushed_at":"2024-06-11T11:37:30.000Z","size":115,"stargazers_count":5,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-11T12:42:40.584Z","etag":null,"topics":["fastcgi","fcgi","raku"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanstowe.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-23T20:46:51.000Z","updated_at":"2024-06-11T11:34:12.000Z","dependencies_parsed_at":"2022-08-12T12:50:34.252Z","dependency_job_id":null,"html_url":"https://github.com/jonathanstowe/raku-fastcgi-nativecall","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2Fraku-fastcgi-nativecall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2Fraku-fastcgi-nativecall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2Fraku-fastcgi-nativecall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanstowe%2Fraku-fastcgi-nativecall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanstowe","download_url":"https://codeload.github.com/jonathanstowe/raku-fastcgi-nativecall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221808988,"owners_count":16883829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastcgi","fcgi","raku"],"created_at":"2024-10-28T08:42:59.074Z","updated_at":"2024-10-28T08:42:59.679Z","avatar_url":"https://github.com/jonathanstowe.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastCGI::NativeCall\n\nThis is an implementation of FastCGI for Raku using NativeCall\n\n![Build Status](https://github.com/jonathanstowe/raku-fastcgi-nativecall/workflows/CI/badge.svg)\n\n\n## Synopsis\n\n```raku\nuse FastCGI::NativeCall;\n\nmy $fcgi = FastCGI::NativeCall.new(path =\u003e \"/tmp/fastcgi.sock\", backlog =\u003e 32 );\n\nmy $count = 0;\n\nwhile $fcgi.accept() {\n\tsay $fcgi.env;\n    $fcgi.header(Content-Type =\u003e \"text/html\");\n    $fcgi.Print(\"{ ++$count }\");\n}\n```\nThere is an example [nginx](http://nginx.org/) configuration in the [examples](examples) directory.\n\nIf you are using Apache httpd with [mod_fcgid](https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html) your script will be executed by the server with its STDIN (file descriptor 0) opened as the listening socket so you don't need to create your own socket and the script above becomes something like: \n\n```raku\nuse FastCGI::NativeCall;\n\nmy $fcgi = FastCGI::NativeCall.new(socket =\u003e 0 );\n\nmy $count = 0;\n\nwhile $fcgi.accept() {\n\tsay $fcgi.env;\n    $fcgi.header(Content-Type =\u003e \"text/html\");\n    $fcgi.Print(\"{ ++$count }\");\n}\n```\n\nThere is a snippet of Apache configuration in the [examples](examples/apache.conf) directory. You will almost certainly want to tweak that to your own requirements.\n\n## Description\n\n[FastCGI](https://fastcgi-archives.github.io/) is a protocol that allows an HTTP server to communicate with a persistent application over a socket, thus removing the process startup overhead of, say, traditional CGI applications.  It is supported as standard (or through supporting modules,) by most common HTTP server software (such as Apache, nginx, lighthttpd and so forth.)\n\nThis module provides a simple mechanism to create FastCGI server applications in Raku.\n\nThe FastCGI servers are single threaded, but with good support from the front end server and tuning of the configuration it can be quite efficient.\n\n## Installation\n\nIn order to use this properly you will need some front end server that supports FastCGI using unix domain sockets.\n\nAssuming you have a working Rakudo installation you should be able to install this with *zef*:\n\n\tzef install FastCGI::NativeCall\n\n\t# Or from a local clone of the distribution\n\n\tzef install .\n\n## Support\n\nI'm probably not the right person to ask about configuring various HTTP servers for FastCGI. Though I'd be interested in sample configurations if anyone wants to provide any.\n\nIf you are running under SELinux with Apache you may find that it won't run your script and you will need to do something like:\n\n    chcon -R -t httpd_sys_script_exec_t /var/www/fcgi\n\nobviously adjusting this to your own circumstances.\n\nAlso the tests are a bit rubbish, I haven't worked out how to mock an HTTP server that does FastCGI yet.\n\nIf you have any suggestions/bugs etc please report them at https://github.com/jonathanstowe/raku-fastcgi-nativecall/issues\n\n## Licence and Copyright\n\nThis is free software please see the [LICENSE](LICENSE) file in the distribution.\n\n© carbin 2015\n© Jonathan Stowe 2016 - 2021\n\nThe FastCGI C application library is distributed under its own license.\nSee \"ext/LICENSE.TERMS\" for the license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanstowe%2Fraku-fastcgi-nativecall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanstowe%2Fraku-fastcgi-nativecall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanstowe%2Fraku-fastcgi-nativecall/lists"}