Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Screenshots Panic Mandelbr Planets Comanche Calc7 Savehd7 Compiler Dnafight Sudoku Wator Tar7 Sydir7 Ftp7 Castle Tetris Make7 Ftpserv Basic Pairs Shisen Eliza Toutf8 Lander Wiz Startrek Mahjong
Screenshots
Comanche Source Code
 previous   up   next 

Comanche is a simple web server for static HTML pages and CGI programs. The Comanche web server is named after the Native American ethnic group which drove the Apaches from the Southern Plains after 1650.

Rationale

Comanche is intended as test tool for HTML pages and CGI programs. CGI Programs written in Seed7 can be tested easily. Comanche does not require any installation, configuration files or superuser/administrator privileges.

Usage

Comanche can be called from a command window with:

comanche [-h | -?] [-p port] [-tls] [html-directory [cgi-directory]]

The 'html-directory' specifies the root directory for HTML files. The default 'html-directory' is "../htdocs". The 'cgi-directory' specifies the root directory for CGI scripts. The default 'cgi-directory' is "../prg". The default 'port' is 1080. Example of a comanche usage:

s7 comanche

When comanche is started it writes some information about its parameters:

HTML directory: ../htdocs
CGI directory: ../prg
Port: 1080

When the file "../htdocs/index.htm" exists you can open it with http://localhost:1080/ in your browser. The CGI program "../prg/cgiExample" can be opened with http://localhost:1080/cgi-bin/cgiExample in your browser.

To stop comanche press CTRL-C. Comanche responds with

*** SIGNAL INTR RAISED

*** Program terminated.

Operation method

Comanche works for files with the .html or .htm extension. The content type of the HTTP response is determined by the extension of the requested file or by a magic number at the beginning of the file. CGI scripts written in Seed7 (extension *.sd7) are executed with the Seed7 interpreter (s7).

Download

Comanche is written in the Seed7 programming language and can be downloaded as part of the Seed7 package. To use comanche it is necessary to compile the Seed7 interpreter. Afterwards Comanche can be started from the directory 'seed7/prg' with:

s7 comanche

Comanche can be also compiled with:

s7c comanche

This creates an executable which can be used without the 's7' interpreter.


Starting Comanche

Comanche serving the Seed7 homepage

Comanche returning "404 Not Found"

 previous   up   next