EvdB has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple command line web server for running cgis.
by Aristotle (Chancellor) on Aug 23, 2004 at 17:38 UTC | |
by EvdB (Deacon) on Aug 24, 2004 at 08:34 UTC | |
|
Re: Simple command line web server for running cgis.
by iburrell (Chaplain) on Aug 23, 2004 at 18:07 UTC | |
|
Re: Simple command line web server for running cgis.
by Your Mother (Archbishop) on Aug 23, 2004 at 20:41 UTC | |
|
Re: Simple command line web server for running cgis.
by Anneq (Vicar) on Aug 25, 2004 at 00:17 UTC | |
|
Re: Simple command line web server for running cgis.
by EvdB (Deacon) on Aug 26, 2004 at 11:11 UTC |