This is a simple proof of concept for generating a webpage in apache from any executable binary.
The binary creates a webpage, supposedly by running the bin with the arg that is the request path. It's run and the output is returned from PHP.
- A user requests a path, the
.htaccess
redirects toindex.php
with the path as a query param. index.php
grabs the path, runs the binary (generate-site.sh
) with the path as an argument.- the binary builds some dynamic html and PHP spits it back as the response.
idk. kinda cool i guess. obviously there's way more overhead than necessary, but most shared hosting servers run apache and this lets you have some simple script-generated webpages!