Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Location
    Farmington, UT
    Posts
    42

    Question Serve a page without a webserver, using a port number?

    I'm interested in serving one page on my server without having to run a webserver. How would I make it so someone can access the one page by going to http://123.456.78.90:1234? Is there some sort of program I can use to do this or is a webserver a must?

    Also, does anyone know how Webmin is authenticating users without MySQL on the server? I'd like to do something like that. Webmin uses port 10000 so I access it using http://123.456.78.90:10000, the same way I'd like to serve my one page to the public.

    Thanks
    Last edited by DOS|Proton; 11-24-2004 at 05:45 AM.

  2. #2
    Join Date
    Jul 2002
    Location
    Manchester, UK
    Posts
    779

    Re: Serve a page without a webserver, using a port number?

    Originally posted by DOS|Proton
    I'm interested in serving one page on my server without having to run a webserver. How would I make it so someone can access the one page by going to http://123.456.78.90:1234? Is there some sort of program I can use to do this or is a webserver a must?

    Also, does anyone know how Webmin is authenticating users without MySQL on the server? I'd like to do something like that. Webmin uses port 10000 so I access it using http://123.456.78.90:10000, the same way I'd like to serve my one page to the public.

    Thanks
    Depending on how many people you were expecting to request the page, you could write a simple server program in Perl or C++ that would simple listen on that port, wait for a request, and then simply send a set response back (i.e. set headers and the actual page itself). Although it would have to be a static page. If you wanted dynamic content you would have to write that into your program yourself.

    As for Webmin, it uses PAM authentication, which allows it to authenticate users as normal unix users (i.e. against /etc/shadow, or /etc/passwd on older systems). I'm pretty sure there's PAM modules available for Perl. Webmin itself is written entirely in Perl so it's certainly possible to create pretty sophisticated server programs in it.

  3. #3
    Join Date
    Oct 2004
    Location
    Farmington, UT
    Posts
    42
    Ah, thanks for the prompt reply. Do you know of any pre-made scripts that do something similar to that, preferably Perl? I'm not good enough to write a Perl program but I'm capable of interpreting and adding on/editing already made scripts. If not, do you know if Apache would take up alot of resources? I woldn't mind running a webserver but I'm just worried that even if it's only serving one page, that it would take up a considerably large amount of cpu & memory for my likings.

  4. #4
    Join Date
    Mar 2004
    Location
    New Zealand
    Posts
    532

    Re: Serve a page without a webserver, using a port number?

    Any time you serve anything to a web browser you are by definition using a web server.

    Webmin has it's own built in web server.

    What I think you mean is, "is there a very very simple webserver I can use to serve one static page of content over a given port?".

    Well, aside from writing your own (all you need do is accept connections and respond to a GET request with the appropriate headers and content), you could look at something like http://www.acme.com/software/thttpd/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •