Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Web server on CD??

by Massyn (Hermit)
on Jan 05, 2003 at 06:58 UTC ( [id://224383]=perlquestion: print w/replies, xml ) Need Help??

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

#!/fellow/monks.pl

I'd like to distribute my CGI application as a demo to customers. However, most of them do not have the time to install Apache to get the CGI working. Is there perhaps a stipped down webserver available, that I can include on my CD distrbution, so that the web server with CGI capabilities can start up from the command line? Thus, all I'll need to do is point to http://localhost/myapp.cgi

Thanks!

#!/massyn.pl The more I learn, the more I realize I don't know. Albert Einstein 1879-1955

Replies are listed 'Best First'.
Re: Web server on CD??
by theorbtwo (Prior) on Jan 05, 2003 at 07:19 UTC

    There are quite a number of small HTTP servers. However, I wouldn't use them. First off, they're more likely, methinks, to be buggy. Secondly, your customers are likely to use Apache -- if your demo runs on the same platform as their server, then that's just another plus. Thirdly, you already need to know how to admin apache; no reason to have to learn another one for no good reason. Fourthly, apache is mature; it's likely that it's been ported to whatever system you want to build a CD for -- win32, linux, mac, random unix of the hour...

    That said, the only tiny web server I've delt with is xirtami, and I'd urge you to avoid it.

    I suspect rather strongly that you can make an apache install that uses entirely reltive paths fairly easily -- make sure to include a .bat file, shell script, and OS<X equiv to launch it with the correct config file.

    Also, don't use port 80 by default. Not only is it a security risk, it'll be a headache for the customer if they already have a server on port 80 on the machine they want to demo on.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Re: Web server on CD??
by seattlejohn (Deacon) on Jan 05, 2003 at 07:26 UTC
    Is a Win32 solution acceptable? TinyWeb is very small (53K .EXE) and claims to support CGI.

    Of course, I can't help but ask if there's a compelling reason to send your customers a physical CD rather than simply point them to a URL on your Web server. The latter option would be less expensive for you -- and as a customer, I'd probably be more likely to go visit a demo site than actually install a piece of demo software locally on my computer.

            $perlmonks{seattlejohn} = 'John Clyman';

Re: Web server on CD??
by tachyon (Chancellor) on Jan 05, 2003 at 09:55 UTC

    Indigo Perl from Indogo Star offers Perl and Apache in one neat Win32 package. Sounds like the go for what you want - you won't even have to package up you Perl scripts. You could wrap the whole thing into a one click to install MSI but would need to read the fair use stuff first of course.

    Alternatively it is possible to package apps up so they will run completely off a CD but this is less trivial.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Web server on CD??
by janx (Monk) on Jan 05, 2003 at 13:46 UTC
    Certainly you can build your own Apache(/mod_perl) to run off a CD.

    But watch out for the files Apache has to have write access to! (Like its own pid-file, log files etc.)
    You probably want to wrap the startup command into a script (Why not Perl ;-)?) to set up the directories you need.

    My advice: Set up Apache to use some directory in the system /tmp for lock-, log-, pidfiles.

    And you could even find some filesystem for your CD that is supported on multiple platforms and put an Apache for each of those platforms on the CD - so no matter what, your clients can use that CD.

    The other reason of course is to show them how cool you are ;-). I always find that important, too.

    Regards,

    janx

Re: Web server on CD??
by Poetic Justice (Monk) on Jan 05, 2003 at 16:19 UTC
    This depends on your sysAdmin/appAdmin skills. You can download a full Linux distro (Trinux) that will boot from a CD. Apache is one of the many packages that you can include with Trinux. Your CGI app could be added to the process as well. This will allow you to control the entire operating environment for your application. It's handy stuff.

    Poetic Justice
Re: Web server on CD??
by foxops (Monk) on Jan 05, 2003 at 18:14 UTC
    I second the TinyWeb idea, I once set it up on my desktop after my boss asked me to publish some phone usage logs (so as to embarras the rest of the department into improving the average). I thought, "Why not make it dynamic?"; so I whipped up some cgi, downloaded TinyWeb, and 3 months later it is still going.
Re: Web server on CD??
by {NULE} (Hermit) on Jan 05, 2003 at 21:17 UTC
    Hi Massyn,

    Two really good small web servers are thttpd and boa. I can personally vouch that thttpd is a great server and really easy to install and configure. In fact I would use it instead of Apache except for mod_perl. Besides - how can you not love a project that uses Bill the cat for its mascot. :)

    {NULE}
    --
    http://www.nule.org

Re: Web server on CD??
by Aristotle (Chancellor) on Jan 06, 2003 at 00:16 UTC

    One server for Windows which hasn't been mentioned yet is Sambar.

    Now, the excellent German computer magazine c't had an article on how to put various daemons on CD-ROM in order to run dynamic content off of it in issue 12/02, but unfortunately there's no English version available (they do offer translations of some articles). The problem you'll have to face in any case is giving the server someplace to write its logs.

    TinyWeb is probably the easiest to fix up: it just writes its logs to whatever current working directory it finds itself in at launch. So it should be trivial to have some Perl wrapper for File::Temp's tempdir which then execs TinyWeb.

    There's also a Win32 daemon called MicroWeb which is specifically written for use on CD-ROMs, but it's cashware.

    Makeshifts last the longest.

Re: Web server on CD??
by johanvdb (Beadle) on Jan 06, 2003 at 14:32 UTC
    I saw IndigoPerl passing the review, they also have a neat product, called MicroWeb. Which is especially targetted to running a web app from a CD, including stuff, like mysql, cgi, perl and other goodies.
    Although being pay-ware, and only available for Win32 machines, I guess this comes close to what you need?

    johanvdb

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found