GM 's Web Server  
(v0.4  -  13th december  2004)
---------------------------------

GMSHTTP realized with:
- SharpDevelop &
- Microsoft Visual Studio .NET®

by Guido Marcheselli
guidomarche@blu.it
http://www.fotovallescrivia.it/gmslab.htm

CopyRight © Guido Marcheselli 2004-2005

This program is without any warranty. Use it at your own risk.

See “4 - II)GMLabHTTPServerConfig.exe” before trying this program!

History

9/10/2004 ver 0.1
-	First release

16/10/2004 ver 0.2
-	Fixed some bugs
-	PHP 4.3 support added. 

18/10/2004 ver 0.3
-	Added enhanced configuration tool
-	Added multi-root feature
-	Added multi-listeners (multi IP:port)

13/12/04 ver 0.4
-	Added remote monitoring

25/6/05 ver 0.41
-	Minor changes in code
-	Enanched documentation and code comments

9/10/2004

1 – What is GMSHTTP
2 – Installation
3 – Files in GMSHTTP
4 – Configure 
5 -  to do..

1

GMSHTTP is a open source  http 1.1 webserver. It implements ONLY the basic http 1.1 functions, but I hope it is compatible with rfc2616 (see rfc2616.txt).

2

To install GMSHTTP, just open the msi file (if you read this, you shuold have done it yet!)

3

After installing the msi package, you should find these files:

I) GMLabHTTPServer.exe

This is used to run the web server in the “user” mode (console) : webserver starts on user click on “start”, and shuts down when the users close the window or log off from windows. Usefull for debugging, it shows all the headers received and the oprations performed, such as TCP connection accepted, closed, ecc.

Since version 0.4, you can either connect to a remote istance of GMSHTTP, running both as a WindowsService or in console mode, in the same PC or other PC.
Remote connection is useful to monitor a service istance of the server in local/remote machine, or to monitor a remote console server istance.

II)GMLabHTTPServerConfig.exe

This is used to configure webserver parameters. You can edit on your own config.xml with notepad, or use this tool. See “4 Configure” for details. Start, Stop and Apply works only with GMLabHTTPServerService installed.
(To start/stop a console server istamce, use “Start”/”Stop” button in GMLabHTTPServer.exe

III)GMLabHTTPServerService.exe

This is a file used to run the server as a Windows Service. You shouldn’t run it from command line, as it won’t work. After install, you shuold see the “GM's Lab Web Server” in windows services list (In Windows Management Console, expand the “Services&Application” node and select “Services”).
After install, the service is set up to start on next boot. You can start it by:
-	selecting it and choosing “start” in Windows Services (see above) list 
-	digiting “net start GMLabHTTPServerService” in command prompt
-	selecting “start” or “apply” in GMLabHTTPServerConfig.exe

Note: to start the service, IT MUST BE INSTALLED! If you installed the msi package, it should be already installed. If you use the zip file, you need to manually install the service. See IV)installutil.exe

IV)installutil.exe

This file come with Frmework 1.1 SDK, and allows you to manually install/unistall a service. Run CMD.EXE, move to installed directory (ex: c:\programmi\GMsLab\GMHttpServer\) and:

to un-install GMLabHTTPServerService , just type
 installutil -u GMLabHTTPServerService.exe

to install GMLabHTTPServerService , just type
 installutil GMLabHTTPServerService.exe

Use this only if you got problem with Service install/unistall, or if you downloaded the .zip package without the installer.
NB The service runs with “SYSTEM” account, to avoid problems with pre-winxp (NT,2000) SO. You can change to other (NetworkService user is a good choice for winxp/2003) after install, via the Windows management Console.

4

To configure GMSHTTP, run GMLabHTTPServerConfig.exe (the link on the desktop). 

Apply will stop and restart the server (windows service mode) after writing new settings. Save write the settings without restarting.
NB If you choose a non existing path as root, every file you search on you web server, using the Web Browser, result in a “404 File not found” response.

Sites tab

-	NAME : this is a description of the site. The check box will determine enable/disable for this site. If site not enabled, no listener will be created for the site, and site won’t be accessible.
-	ALIAS (virtual path): the name used to access the site. Es alias=”music” will be accessible from “http://<IP>:<port>/music/”
-	ROOT: the physical path mapped to the ALIAS. If root=”C:/mp3/”, then “C:/mp3/ConfortablyNumb.mp3” will be accessible at “http://<IP>:<port>/music/ConfortablyNumb.mp3” (if alias=”music”)
-	IP: is the IP you want the site available on
-	PORT: is the PORT you want the site available on

N.B. Remember to click “Commit changes” to update your changes, and then to Save.

For each site, you can see a sample url in the left corner of the configuration window.

PHP tab

-	A path to the php.exe executable. Note that I rely on php.exe 4 or 5 parameter sintax. If something change in the future, future php.exe won’t be supported.

Monitoring tab

-	LOGS: a path to store log files in. A Error/Log log files couple is saved foreach listener created. Every day a new file is created. A “global” log file is also created, with info about service start/stop.
-	REMOTE MONITOR: this is the IP where the Remote Monitor Listener will be listening for remote monitors.

5

-	Add support for other metods such as PUT, POST…