I have searched for some small webservers that can do CGI and can be started with just a command line. I have found a partial answer in mini_httpd. Running something like mini_httpd -p 8080 -c '**.pl' will start a server which uses the current directory as its base, it will listen on port 8080 and will treat anything ending in .pl as a CGI script.
Unfortunately there does not appear to be sensible error logging so a special line is required at the top of each script:
#!/usr/bin/perl open STDERR, ">>errors" if $ENV{SERVER_SOFTWARE} =~ m/^mini_httpd/; use strict; use warnings; use CGI::Carp; use CGI; warn "This is a warning"; print CGI->header; print "Hello"; print "<br>$_ : $ENV{$_}\n" for keys %ENV;
Does anyone have a solution to this problem. I want to start a server from the command line that lets me test scripts. Obviously this server will be very simple, only just enough for CGI scripts.
This is the list of servers I scanned to find mini_httpd.
--tidiness is the memory loss of environmental mnemonics
In reply to Simple command line web server for running cgis. by EvdB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |