User Tools

Site Tools


cgi_programming

CGI Programming on SDF

Aside from putting Javascript in your web pages that run in visitors' to your web pages browsers, you can run server side programs called from browsers. This is referred to as “CGI Programming” (CGI stands for “Common Gateway Interface”) which you can do here on SDF.

Here is good starter information in the SDF FAQ system: https://sdf.org/?faq?WEB?02

Here are some further tips:

  • Passing parameters to a CGI script - example of setting up a CGI script that can process parameters in the URL
  • Safe CGI - at the User level, you can run CGI scripts in your web space, but it can be tricky, so you should consult this guide
  • if you want to try creating CGI with the bash shell language, bashlib is an old tool that may help
  • If you are interested in Perl CGI programming:
    • **Don't use the old CGI.pm for perl CGI anymore** - At ARPA level, you can write CGI scripts in perl, but you shouldn't use old perl CGI package recipes to do so, because like bash CGI, it's not very safe. Instead, use one of the following modern replacements:
    • Use CGI::Tiny, a non-framework modern replacement for standalone perl CGI: Perl CGI But I Don't Want to Use a Framework. You can easily install in your user perl library, and it works great! Mojo Templates are installed on both the SDF cluster and on the metaarray, and CGI::Tiny works with (safe) templates to prevent XSS, plus it works with other template engines which the docs have examples for.
    • Use Plack, it can be set up in your SDF space and run as CGI even though it's designed around a web framework and its own webservers.
    • Mojolicious and Mojolicious Lite are well-known Perl CGI frameworks, but at present do not work on SDF.
cgi_programming.txt · Last modified: 2023/04/06 20:49 by peteyboy