Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple HTTP server application for Windows that can be launched on-demand?

I need a simple HTTP server application that meets the following criteria:

  1. It must run on Windows.
  2. It must NOT require new Windows installations of any sort: programs, frameworks, services, etc.
  3. It can be run with Java (e.g. JARs) or .NET as those frameworks are already installed globally on the servers.
  4. It must be able to be started and stopped by an Ant build (and/or from command line) on demand.
  5. It must be able to host on a port specified at runtime (i.e. not in a config file).
  6. It must only be able to host basic static content (JavaScript, CSS, Images, HTML) from a root directory specified at runtime (i.e. not in a config file).
  7. Must not require a huge distribution folder, e.g. the full Jetty distribution is approximately 40 MB... way too big! Under 1 MB would be preferred.
  8. It does NOT need to support HTTPS (SSL).
  9. It does NOT need to integrate with any IDEs.
  10. It does NOT need to host any "web applications", e.g. EARs, WARs, JARs, etc.

Any recommendations? I will also need a guide/tutorial explanation for setting them up, especially if they are Java-based as I have very little background in Java (and honestly not that much background in Ant, either).

Thanks!

like image 798
James M. Greene Avatar asked May 11 '12 16:05

James M. Greene


3 Answers

I would recomment onehttpd - https://code.google.com/p/onehttpd/

It's one 62.5K executable. You can run it as easy as onehttpd.exe -p 80 c:\var\www.

like image 135
Juraj Avatar answered Oct 19 '22 16:10

Juraj


Here are some lightweight web servers that appear to work on Windows and have minimal dependencies:

Resin: http://www.caucho.com/resin-web-server/ <-- Requires java

Hiawatha: http://www.hiawatha-webserver.org/

Cherokee: http://www.cherokee-project.com/doc/

like image 45
Eric Avatar answered Oct 19 '22 15:10

Eric


If you need a very light HTTP server, you can use NanoHTTPD. It is distributed as a tiny Jar (an unique class if I recall well).

Also, it is very easy to modify according to your needs (and BSD licensed).

http://elonen.iki.fi/code/nanohttpd/

like image 1
Pierre Salagnac Avatar answered Oct 19 '22 16:10

Pierre Salagnac