Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Lightweight equivalent of Apache/CGI?

by radiantmatrix (Parson)
on Mar 25, 2005 at 16:21 UTC ( [id://442365]=perlquestion: print w/replies, xml ) Need Help??

radiantmatrix has asked for the wisdom of the Perl Monks concerning the following question:

O great monks, I beg your patience as I ask a question which is tangentally related to Perl.

I have written a web application in Perl, which works using CGI under Apache. I have been asked to come up with a version that will work on a notebook PC. Now, the obvious choice is to install Apache on the notebook and let 'er rip. But, installing Apache or IIS on PC's is banned outside the development environment. Also, this hardware is old, and Apache on Windows isn't exactly lightweight.

Has anyone in the Monestary found a lightweight HTTP server that supports Perl CGI? I have tried both Google and SuperSearch, but perhaps I am searching foolishly, for I have found no answer. My only other option is to write a new Tk- or Win32::GUI-based interface for the thing; obviously a more painful process.

Of course, I would give preferrential treatment to HTTP servers that are cross-platform. Anyhow, I thank you all in advance for any help ye can give.

Update: At least two people have suggested RYO solutions. And, while I am thankful for their module recommendations, unfortunately I think I'd be better off writing a Tk interface (which I know how to do) than implementing my own HTTPd (which I've never done before).

Update: Thanks to all the monks for the many suggestions. After considering many of them, I settled on HTTPi, which is pure Perl and rather fast. It also gives me all the %ENV vars I need, handles IP-based restriction (e.g. configured to allow connections only from 127.0.0.1) and runs Perl CGI quite well.

radiantmatrix
require General::Disclaimer;
s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}

Replies are listed 'Best First'.
Re: Lightweight equivalent of Apache/CGI?
by The Mad Hatter (Priest) on Mar 25, 2005 at 16:32 UTC
Re: Lightweight equivalent of Apache/CGI?
by FitTrend (Pilgrim) on Mar 25, 2005 at 17:45 UTC

    I've found several different lightweight httpd on the web, some written in perl. Here is my goodie list.

  • Boa WebServer - http://www.boa.org/
  • httpi - http://www.floodgap.com/httpi/
  • Jellybean - http://www.wgz.org/chromatic/jellybean/
  • I haven't personally played too much with them. However, I have spent time looking into what would meet my needs. These seem pretty good. I'd say httpi and jellybean the first ones I'd look at.

    Then of course there are the perl modules, HTTP::Daemon (which was already mentioned), HTTP::Server::Singlethreaded, and a few others from activestate and cpan.org.

    Hope this helps

Re: Lightweight equivalent of Apache/CGI?
by borisz (Canon) on Mar 25, 2005 at 16:49 UTC
Re: Lightweight equivalent of Apache/CGI?
by polettix (Vicar) on Mar 25, 2005 at 16:57 UTC
    I usually look for Windows stuff at Download.com. A simple search brougth me to something interesting: this one. I don't know if it's actually light, anyway. BTW, they obviously claim to support Perl!

    Flavio

    Don't fool yourself.
Re: Lightweight equivalent of Apache/CGI?
by zentara (Archbishop) on Mar 25, 2005 at 16:30 UTC
    I use to play around with running cgi with those mini-servers, but it has been awhile. Go to http::freshmeat.net and search for "httpd". You probably will find one.

    I'm not really a human, but I play one on earth. flash japh
Re: Lightweight equivalent of Apache/CGI?
by perlfan (Vicar) on Mar 25, 2005 at 16:28 UTC

      My employer provides me with the PDK from ActiveState. It does not have an HTTP daemon, at least that I can tell.

      radiantmatrix
      require General::Disclaimer;
      s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}

Re: Lightweight equivalent of Apache/CGI?
by tilly (Archbishop) on Mar 25, 2005 at 20:48 UTC
    You can look at chromatic's Jellybean server. I've never used it, but it is pure Perl (hence portable), is easily installed and does HTTP.
Re: Lightweight equivalent of Apache/CGI?
by tcf03 (Deacon) on Mar 25, 2005 at 19:56 UTC
    thttpd will work for you. Ive used it often for similar projects.

      It does not appear to work for Windows. Neat little app, though; it's a shame I'm deploying on Win32 for about 85% of userbase.

      radiantmatrix
      require General::Disclaimer;
      s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}

Re: Lightweight equivalent of Apache/CGI?
by djantzen (Priest) on Mar 25, 2005 at 21:56 UTC

    This seems first like a political/policy question, and secondarily a technological one.

    installing Apache or IIS on PC's is banned outside the development env +ironment
    What rationale exists for banning the use of these webservers that would permit the use of another? It sounds to me like the people who made this rule don't want webservers -- any webservers -- running outside of their control. While you would be following the letter of the law in using a smaller (in size and in public stature) server, I expect you'd be violating the spirit. I'd guess the prohibition is in place for security reasons and monitoring of traffic, and frankly these issues are going to be more pertinent using a roll-your-own or less proven product.

    If this application really is something that people in your company want, then seek approval to use Apache on that local machine or on a server that the necessary clients can access. (Why does it need to be local anyway?) Trying to sneak it under the radar could come back to bite you.


    "The dead do not recognize context" -- Kai, Lexx

      I'd guess the prohibition is in place for security reasons and monitoring of traffic

      You would think that, wouldn't you? But that's actually not the case.

      It is not an issue of "any webservers". It is that the web team supports all instances of Apache and IIS across the enterprise. They don't want the headache of supporting workstation installs, so we cannot install those on workstations. By choosing another lightweight server, the application support team is handed the responsibility of securing and supporting it; therefore, that's the route we're persuing.

      It needs to be local because there are people who the Board says need to work on it on notebook PC's while not connected to the network. Because of the type of app it is, that's fine; but I don't want to get stuck developing a new interface when we have one (in a browser) that works fine.

      radiantmatrix
      require General::Disclaimer;
      s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}

        FYI - in some organisations, one can file for a formal exception to the process. Theoretically, as long as the process for gaining exceptions is documented, and the formal exception itself is in writing (even if that is an email, if allowed by the process), you can get the exception and still claim full ISO9000 compliance. Back to reality, and we find that politics can easily despoil this utopia of ISO9000 compliance. (Well, as utopic as ISO9000 can be ;->)

        Short version: I'd look for a formal exception if possible. Of course, you may have already pursued this course, in which case I point it out solely for posterity in case someone else happens upon this thread in the same situation.

        (PS - The last time I saw "security" and "IIS" in the same sentence was in a MS advertisement, so I already guessed the OP was incorrect in their guess ;-})

Re: Lightweight equivalent of Apache/CGI?
by Arunbear (Prior) on Mar 25, 2005 at 20:10 UTC
Re: Lightweight equivalent of Apache/CGI?
by Errto (Vicar) on Mar 25, 2005 at 23:35 UTC
    You can use HTTP::Daemon and CGI::Simple together to achieve the result you want. Yes, there is some rolling your own here. But think about it: running CGI under Apache isn't magic, you still have to configure it. GUI with HTTP::Daemon sounds pretty much like what you want.
Re: Lightweight equivalent of Apache/CGI?
by chas (Priest) on Mar 26, 2005 at 02:36 UTC
    I posted a mini "web server" in 441115 recently. It's not too ambitious, but might be useful to you. (Several others have already suggested something of this sort.)
    chas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://442365]
Approved by kutsu
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-19 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found