public WebServerCGIExample() {
// instantiate a new web server
WebServer webServer = new WebServer();
// add a cgi module using perl as backend for files ending with .pl (adjust path to perl executable as needed)
HttpCgiModule httpCgiModule = new HttpCgiModule("/usr/bin/perl", ".pl");
// instantiate a single file resource
HttpFileResource perlFile = new HttpFileResource();
// set the path we can use to open the file e.g. with a web browser
perlFile.setRelativePath("/index.pl");
// set the path where the file is located on disk
perlFile.setServerPath(WebServerCGIExample.class.getResource("/examples/perlCgiTest.pl").getPath());
// add the newly created resource to the module
httpCgiModule.getResources().addResource(perlFile);
// add the module to the server
webServer.addModule(httpCgiModule);
// create an http listener for InetAddress.getLocalhost() on port 11111