1
Thanks

A few words of thanks would be greatly appreciated.

TinyWeb Server on Windows

The server requirements of a webmaster working on a website may vary from time to time. If they are constrained by a small size, minimal memory, speed and low costs, then tinyweb offers a nice solution. Not only is a extremely small server, it also works without installation. It can be easily run on Windows OS by accessing it via command. One of the best features about this server is that the webmaster can launch multiple tiny web browsers at any given point in time. All these features make this a very handy tool on Windows for those who feel restricted while working with their usual servers.




Introduction to TinyWeb

TinyWeb is a lightweight server for Windows, which works quickly and is very precise.

Features:

  • It doesn't require installation.
  • Ultra-compact (only 59kb in size).
  • Consumes less than 3 MB of memory.
  • Very fast .
  • Free .


Download Tinyweb

To run TinyWeb

  • You will have to create an index.html file:
    • Example: c:\www\index.html
  • Then add some content, e.g.:
    <html><body>Hello, world !</body></html>
  • In the command line, run:
    tiny c:\www
    • Note: You need to use the absolute path
    • Check the result on :http://localhost

How to Stop TinyWeb

  • Open the Task Manager (CTRL+Alt+Del) and end the process tiny.exe
  • Or, using the command line:
    taskkill /F /IM tiny.exe

CGI

You can use TinyWeb for CGI:
  • Create a file:
    c:\www\cgi-bin\test.bat
  • Add the following code:

@echo off     
echo Content-type: text/plain
echo.
echo.
echo Hi !
echo Your IP ADDRESS is %REMOTE_ADDR% and your BROWSER is %HTTP_USER_AGENT%
  • Go to:http://localhost/cgi-bin/test.bat


You can launch several Tiny web servers simultaneously.

Note: there is also an SSL version, which is also free - TinySSL. Download it here.

Binay Files in CGI

Unlike Unix / Linux, the Windows console does not use binary data by default. If your CGI needs to send binary files you will need to force it into binary mode manually. For example in Python:

import sys     
if sys.platform == "win32":     
    import os, msvcrt     
    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)


Image: © Unsplash
1
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
Related
This document, titled « TinyWeb Server on Windows », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!