You can get the source code from the subversion repository here, and there’s a trivial example JS script here. To build mod_js, make sure that the
apxs binary for the apache to want is in your path (or set the APXS environment variable to the right binary) and run:
$ perl make.pl $ sudo perl make.pl install
You’ll need root to install the module, and a working perl to run make.pl. I don’t use perl for anything clever - I just prefer it to writing makefiles. Once the module is installed, edit your apache config file and add:
ScriptAlias /js-scripts /some/path/to/scripts AddHandler js-script .jss
Right now you can’t do a lot in a script - ‘print’ is about it. There’s a ‘request’ object available to the script that contains the CGI arguments, local script environment and any data that was posted to the script, so you can write simple CGI scripts, but there’s no access to the local filesystem or any database drivers (SQLite is linked in, and has very limited support, but it’s not useful yet). It’s possible that this situation will never get better - see the musing here for my reasoning.