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

Hi.

I've just started using the HTTP::Daemon on Windows 95, but since I'm a newbie to this module, I'm having some problems.

Is there a way I can indicate the path in my computer where html files are stored, so that these open when a client makes a request?

Ralph :)

Replies are listed 'Best First'.
Re: Using the HTTP::Daemon on Windows 95
by arturo (Vicar) on Feb 15, 2001 at 04:02 UTC

    Third time's a charm? Really, make life easy on yourself. Download Apache, the world's most popular web server (they have scads of documentation on the site, but IIRC setup on Win32 is a relative breeze, certainly much easier than writing a stable daemon, even w/the modules you're using).

    Yes, it runs on win95, and there is a huge amount of free documentation and troubleshooting help available for it. You really don't need a perl module. If you want to learn how to use Perl more generally, we're always willing to help. But use the right tool for the job.

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Re: Using the HTTP::Daemon on Windows 95
by merlyn (Sage) on Feb 15, 2001 at 01:07 UTC
Re: Using the HTTP::Daemon on Windows 95
by Anonymous Monk on Feb 15, 2001 at 01:25 UTC
    Hi.

    But would anyone know then what is the code I should write to be able to perform this? Or am I gonna have to write like a whole new module? Any ideas for how to write a super simple web server in perl that will just serve files from a certain directory?

    Thanks,
    Ralph :)
      Jellybean does exactly that. It uses HTTP::Daemon and has an included module called Jellybean::FileContainer.

      It's not super simple, and it does a whole lot more than that, but it's a start. And it runs on Windows. (And there's a new version coming out in test form tonight, and final release this weekend.)

Re: Using the HTTP::Daemon on Windows 95
by Anonymous Monk on Feb 15, 2001 at 03:10 UTC
    Hi.
    Thanks for the reply!

    I've been looking at jellybean, but it's too complex for the type of thing i want to do.

    I want my perl script to do the following:
    - Open a port on my ip so that i can serve files (eg. 24.232.100.39:1280 )
    - Then, for example: a user requests the following url: 24.232.100.39:1280/mp3/ and he/she gets a listing of the files in, for example, E:\Mp3\ .

    This is all I want to do. Is it really so hard?

    Thanks,
    Ralph :)

      If that's all you want to do, why not use one of the multitude of free webservers that are available? I think apache runs on Win95, I know that there are others. I'm sure a Google search will turn up at least a dozen. And don't forget to check TUCOWS.

      --Chris

      e-mail jcwren
Re: Using the HTTP::Daemon on Windows 95
by Anonymous Monk on Feb 15, 2001 at 04:02 UTC
    Hi.
    Thanks for the reply!

    The thing is i don't want to use a web server, cause I'm actually trying to make a file sharing small program in perl. And one of the things i need to get done is that a port gets open so that files can be shared.

    Isn't there a simple way of doing what I describe in my previous comment?

    Thanks,
    Ralph :)