Best lightweight web server (only static content) for Windows [closed]
Asked Answered
W

8

227

I got application server running in Windows – IIS6.0 with Zend Server to execute PHP. I am looking for lightweight static content only web server on this same machine which will relive IIS form handling static content and increase performance.

It need to be only static content web server – maximum small and maximum effective – lighttpd seems too big because allow to FastCGI.

I am looking for: Windows, static content only, fast, and lightweight.

I am using Windows Server 2003.

Weismann answered 19/2, 2011 at 12:48 Comment(14)
@horse he's already got IIS, what advantages would Apache offer?Lacustrine
Which version of Windows is your target?Superposition
@David: What advantage would any "lightweight static content server" have over IIS? IIS is absolutely capable of serving static content - just as ApacheFlaunt
@a_horse I think that's the point I'm making. I would regard IIS and Apache as pretty similar. Heavyweight gorillas. You wouldn't switch from IIS to Apache just to serve static content. Then you'd have two servers to manage and secure and no discernible benefit!Lacustrine
@David: I have never pictured Apache as "heavy weight" - as you can easily remove any module you don't need. But to me the original question does not really make sense - or I'm not understanding it.Flaunt
@a_horse the lightweight servers can, for some workloads, handle much higher throughputLacustrine
If Windows wouldn't be a requirement, the Boa web server seems be exactly what you are searching for. boa.orgSchoen
Can we assume that the server must support gzip content-encoding (to reduce bandwidth) but need not support any authentication methods nor SSL (restricted access, proof of server identity)?Comment
@james - Yes - gzip is welcome, SSL not ( speed is the goal )Weismann
@DavidHeffernan - I always use Heavyweight Gorilla servers.Tacky
You can try siteonyourdevice.com, - Http 1.1 protocol. - Http 2 protocol. - Basic & digest authentication for secure access. - Directory index. - Cross-platform support. - Open source(we only transfer web content, you can check that on next link: project sources).Eluviation
For dev on local with static content just use: "chrome.exe --allow-file-access-from-files"; nearly every one has :), no memory footprint :v, no need to install :v, no need to config :v; no need DNS resolve :DImpertinent
go-www.comPharmaceutics
The question Extremely simple web server for Windows? on superuser.com names a few more.Motionless
T
198

Have a look at mongoose:

  • single executable
  • very small memory footprint
  • allows multiple worker threads
  • easy to install as service
  • configurable with a configuration file if required
Tribune answered 25/2, 2011 at 15:50 Comment(19)
Crashes are not something I have experienced so far.Tribune
Worked for me. One problem when serving unicode text file.Bloodshot
Not really fast when the served files are large (like > 500KB) then it gets serious performance problems.Engdahl
Mongoose is no longer free. The Uniform Server (uniformserver.com) is a lightweight server solution for running a web server under the Windows OS. It includes the latest versions of Apache2, Perl5, PHP5, MySQL5, phpMyAdmin and more. No installation required. No registry dust. Just unpack and fire up.Brynhild
@Brynhild I am not sure what you mean by "mongoose is no longer free": It is dual-licensed GPL2 and commercial. GPL2 is clearly a free license. Furthermore until commit 04fc209(including) in August 2013 it was distributed under what amounted to a copyleft license. You can still use that if the GPL2 is an issue for you.Tribune
I just put it in the root folder of the static website, and run it, that's all!Gemology
Mongoose is very nice and simple. Unfortunately it does not support url encoded accented characters (basically if the file name contains any non ASCII character mongoose doesn't serve it)Tarsia
user guide docs.cesanta.com/mongoose_binary/dev/#/config-fileShf
for me it doesnt listen to remote requests, only locally it works, give upShf
I got annoyed that mongoose became so commercialized so I made a simple Golang based static server and released on GitHub: github.com/ethanpil/sheretHypochromia
@Hypochromia Looks very interesting. I tried to run the binary you provided on Windows 8.1 but got a Windows error message "This app can't run on your PC". One thing that made mongoose popular was that binaries were provided. Maybe you could fix this?Tribune
@Tribune maybe I built a 64bit binary and you are on a 32bit system?Hypochromia
@Hypochromia I am indeed using a 32bit system. Could you provide a 32bit version of the executable? That would also run on 64bit systems.Tribune
Mongoose binary fails windows virus detection.Cadaver
@Jurgen Check the category the virus check reports, but probably it’s just the fact that it tries to listen on external ports.Sporades
Antivirus detection rate 21/70: virustotal.com/gui/file/…Azaleeazan
Yes but with things that sound more like heuristics or part of other detections. I assume that the tool was abused in some malware, that doesn't make the tool itself bad.Leblanc
I've found CivetWeb to be a good replacement (it was forked from mongoose in 2013).Solis
Look at the آHadid web server link.Sutlej
M
278

You can use Python as a quick way to host static content. On Windows, there are many options for running Python, I've personally used CygWin and ActivePython.

To use Python as a simple HTTP server just change your working directory to the folder with your static content and type python -m SimpleHTTPServer 8000, everything in the directory will be available at http:/localhost:8000/

Python 3

To do this with Python, 3.4.1 (and probably other versions of Python 3), use the http.server module:

python -m http.server <PORT>
# or possibly:
python3 -m http.server <PORT>

# example:
python -m http.server 8080

On Windows:

py -m http.server <PORT>
Mathers answered 26/2, 2011 at 17:17 Comment(14)
thus the "OR install ActiveState python" or any other version of python :-).Mathers
You can even leave out the "8000" it seems to default to port 8000.Berwick
I use it often to throw up quick pages to test if a TCP port is open, for example : echo "you made it..." > index.html; nohup python -m SimpleHTTPServer 10195 > service_startup.log 2>&1 &Mathers
I would suggest this as solution number one to developers working on Linux or MacOS, where Python is quite possibly already there.Serendipity
This is the single most useful thing I have read all day. I, bearer of @CamiloMartin's cannon ball, have been banging my head, trying to make Apache run on Cygwin. Like a terrible nitemare. And all to serve static content. eSniff-ster: Brilliant.Hornsby
This is simply awesome! Solves all my needs and works much better than the Mongoose server (python handles all url-encoded paths flawlessly).Tarsia
Why would you need Cygwin or ActivePython installed? Any installation of Python will work, particularly the default installation that most devs would have.Lanellelanette
@Lanellelanette Any version of python would work. I haven't used windows for many years, but back then I only ever used Cygwin and IronPython windows.Mathers
the python simplehttp server started from command line doesn't seem to support PHP. But PHP does. #12236376 start php -S 127.0.0.1:80 -t . (Note I suggest using start, to keep your current cmd window available.. like that, or running a bat that starts the web server with start)Tia
@Tia The OP was how to host static files. Php, etc would be a different question :), but thanks for linking to the php answer for those looking for that.Mathers
@Mathers That DOES host static files. If you make an index.html and have it in e.g. the root directory and got there, it will display index.htmlTia
Sort of an aside, but php -S localhost:8080 will as well. It serves static content, but unfortunately also executes php files as though it were mod_php. This may work for some.Anisaanise
@CamiloMartin The files are dead, aren't they? I'm happy with my swiss-army cannonball. Having access to a functional bash environment on Windows is immensely useful.Cranwell
Why does this have so many upvotes! What about the constraint lightweightVary
T
198

Have a look at mongoose:

  • single executable
  • very small memory footprint
  • allows multiple worker threads
  • easy to install as service
  • configurable with a configuration file if required
Tribune answered 25/2, 2011 at 15:50 Comment(19)
Crashes are not something I have experienced so far.Tribune
Worked for me. One problem when serving unicode text file.Bloodshot
Not really fast when the served files are large (like > 500KB) then it gets serious performance problems.Engdahl
Mongoose is no longer free. The Uniform Server (uniformserver.com) is a lightweight server solution for running a web server under the Windows OS. It includes the latest versions of Apache2, Perl5, PHP5, MySQL5, phpMyAdmin and more. No installation required. No registry dust. Just unpack and fire up.Brynhild
@Brynhild I am not sure what you mean by "mongoose is no longer free": It is dual-licensed GPL2 and commercial. GPL2 is clearly a free license. Furthermore until commit 04fc209(including) in August 2013 it was distributed under what amounted to a copyleft license. You can still use that if the GPL2 is an issue for you.Tribune
I just put it in the root folder of the static website, and run it, that's all!Gemology
Mongoose is very nice and simple. Unfortunately it does not support url encoded accented characters (basically if the file name contains any non ASCII character mongoose doesn't serve it)Tarsia
user guide docs.cesanta.com/mongoose_binary/dev/#/config-fileShf
for me it doesnt listen to remote requests, only locally it works, give upShf
I got annoyed that mongoose became so commercialized so I made a simple Golang based static server and released on GitHub: github.com/ethanpil/sheretHypochromia
@Hypochromia Looks very interesting. I tried to run the binary you provided on Windows 8.1 but got a Windows error message "This app can't run on your PC". One thing that made mongoose popular was that binaries were provided. Maybe you could fix this?Tribune
@Tribune maybe I built a 64bit binary and you are on a 32bit system?Hypochromia
@Hypochromia I am indeed using a 32bit system. Could you provide a 32bit version of the executable? That would also run on 64bit systems.Tribune
Mongoose binary fails windows virus detection.Cadaver
@Jurgen Check the category the virus check reports, but probably it’s just the fact that it tries to listen on external ports.Sporades
Antivirus detection rate 21/70: virustotal.com/gui/file/…Azaleeazan
Yes but with things that sound more like heuristics or part of other detections. I assume that the tool was abused in some malware, that doesn't make the tool itself bad.Leblanc
I've found CivetWeb to be a good replacement (it was forked from mongoose in 2013).Solis
Look at the آHadid web server link.Sutlej
D
7

The smallest one I know is lighttpd.

Security, speed, compliance, and flexibility -- all of these describe lighttpd (pron. lighty) which is rapidly redefining efficiency of a webserver; as it is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting and many more) lighttpd is the perfect solution for every server that is suffering load problems. And best of all it's Open Source licensed under the revised BSD license.

Edit: removed Windows version link, now a spam/malware plugin site.

Dwyer answered 27/2, 2011 at 6:56 Comment(8)
How do you install it lighttpd on Windows?Mike
just follow the links... the page with the installer is en.wlmp-project.net/downloads.php?cat=lightyDwyer
The windows port appears to be abandoned... (sad to see)Confine
Windows and Linux are abandoned by the maintainer.Engdahl
Linux is definitely not abandoned, it's still getting updates in repos as of the last bugfix in January. Windows can still be compiled, but who knows if there are lurking bugs.Lanellelanette
I also used lighttpd. It works wonders. I'm hosting video content via this.Parish
@OphirYoktan Your link is no longer valid. Do you know any other site where we can download an actual lighttpd version for Windows?Guess
lighttpd _WIN32 native port: wiki.lighttpd.net/DevelWin32 (github.com/gstrauss/lighttpd1.4/tree/win32-exp) can be compiled to a single static lighttpd.exe or to use .dlls. No binary download available at the moment.Working
C
3

Consider thttpd. It can run under windows.

Quoting wikipedia:

"it is uniquely suited to service high volume requests for static data"

A version of thttpd-2.25b compiled under cygwin with cygwin dll's is available. It is single threaded and particularly good for servicing images.

Comment answered 26/2, 2011 at 17:39 Comment(0)
L
1

Have a look at Cassini. This is basically what Visual Studio uses for its built-in debug web server. I've used it with Umbraco and it seems quite good.

Lizabethlizard answered 19/2, 2011 at 13:28 Comment(1)
only static content and fast ... seriously ?Sumpter
A
1

I played a bit with Rupy. It's a pretty neat, open source (GPL) Java application and weighs less than 60KB. Give it a try!

Attempt answered 25/2, 2011 at 16:57 Comment(1)
But needs the huge java setup.Engdahl
U
1

You can try running a simple web server based on Twisted

Unselfish answered 28/2, 2011 at 9:32 Comment(0)
B
1

nginx or G-WAN

http://nbonvin.wordpress.com/2011/03/24/serving-small-static-files-which-server-to-use/

Beaker answered 4/9, 2011 at 14:5 Comment(1)
nginx on Windows is not the best choice. Setting it up as a service is not simple (OP wanted this), the service sometimes refuses to stop, and once every couple of months it fails to start with no explanation in the logs.Vitriolic

© 2022 - 2024 — McMap. All rights reserved.