WWW Server
Overview
This goody implements a Web Server with additional functionality
In addition to serving HTTP file requests, this server allows for
smalltalk applications to register themself as request handlers,
and thereby generating HTML responses dynamically (i.e. programmatically).
This dynamic HTML may be either generated directly by a smalltalk
object, or by executing embedded smalltalk found in a file document.
The HTTPServer consist of a merged functionality from the original ST/X
server, the PWS (pluggable web server) code as provided with the Squeak PWS-Swiki,
and (new) compatibility code to support comanche applications.
Features are:
- supports multiple servers on multiple ports
- regular file access via a configurable root directory (or multiple virtual roots)
- configurable file caching
- configuration via the Launchers settings dialog and/or via http.
- keep alive connections (HTTP1.1)
- basic and MD5 based digest authentication schemes
- temporary (graphic) links for generated images
- SOAP callout mechanism
- can be compiled into a standAlone webServer (see the projects/webServer directory)
- pluggable applications (Services) includes demos for
- hello world
- process monitor (i.e. monitoring ST/X)
- a very simple webShop application
- PWS-applications:
include:
- editable pages (everyone may edit)
- authorized pages (edit by authorized people only)
- embedded smalltalk pages
- ComSwiki
These include:
- modern Swiki with flexible/dynamically changable styles
- administration via http
Documentation
See the documentation methods in HTTPServer;
Especially:
HTTPServer howToStart.
HTTPServer howToConfigure.
ComSwiki documentation found on Swiki-FAQ.
And, use the source - Luke.
There is a lot of informatio nto be found on the various swikis;
however, the following seems to be of special interest and is
therefore included here:
Apache as frontEnd
Text from Xerxes Rånby (found on Swiki-FAQ)
Apache as a "frontend" on top of Comanche using "reverse proxying" and "virtual hosting".
Here is a vhost entry for the apache 1.3 httpd.conf file
for a virtual domain called "http://www.foo.com"
I hope this will help.
dont forget to load your proxy and rewrite module, rewrite is used to handle some misplaced url's.
LoadModule proxy_module /usr/lib/apache/modules/libproxy.so
LoadModule rewrite_module /usr/lib/apache/modules/mod_rewrite.so
ServerName wiki.foo.com
#basic you will need something like this
ProxyPass / http://www.foo.com:8000/foo/
ProxyPassReverse / http://www.foo.com:8000/foo/
RewriteEngine on
RewriteRule ^/foo/(.*)$ /$1 [R]
#move of some files located in / on the original swiki
RewriteRule ^/comanche.gif$ http://www.foo.com:8000/comanche.gif [R]
RewriteRule ^/favicon.ico$ http://www.foo.com/favicon.ico [R]
#These rules makes apache handle heavy workload for uploads and button graphics.
#note these two "speedups" will not work on ComSwiki 1.3 for files with spaces in the filename.
RewriteRule ^/schemes/foo/(.*)$ http://www.foo.com/foo_scheme/$1 [R]
RewriteRule ^/uploads/(.*)$ http://www.foo.com/foo_uploads/$1 [R]
#Forces edit page requests to go to the slower wiki. if you never want to reveal your true swiki url remove this line.
RewriteRule ^/(.*.edit)$ http://www.foo.com:8000/foo/$1 [R]
Examples
Start up the HTTPserver (see the launchers communications-settings dialog),
and your favourite browser.
The server may also be started programmatically, by evaluating:
HTTPServer startServer
or:
HTTPServer startServerOnPort:aPortNumber
Notice, that the HTTPServer cannot usually serve on the default HTTP port
(80), because this is a system port, which cannot be served by non-priviledged
users.
Therefore, the default port is 8080, which is a non-priviledged port
(you must run ST/X as superuser, or make it a setuid-root program,
in order to allow serving the priviledged port).
Do not forget to enter the correct port number in the browser
(i.e. enter the URL "http://hostname:port/").
Depending on which features were enabled in the settings dialog,
the default page includes links to demonstrate features of the server.
Be aware, that the home page is just a pluggable service, and that it is
very easy to create your own one (have a look at the WebHomePageForSTX class
to see how).
Licensing
This addOn package is NOT to be considered part of the base ST/X system.
It is provided physically with the ST/X delivery, but only for your
convenience.
Legally, it is a freeware or public domain goody, as specified in
the goodies copyright notice (see the goodies source).
No Warranty
This goody is provided AS-IS without any warranty whatsoever.
Notice
The PWS code is no longer maintained (but kept there for backward compatibility).
We recommend using the HTTPService interface scheme for new applications.
Origin/Authors
HTTPServer is a merge of the original file-based ST/X httpServer,
the PWS (Pluggable Web Server) as provided by Squeak developers,
and (new!) the ComSwiki code.
Origin/Authors:
Squeak (PWS and ServerAction hierarchy))
Claus Gittinger (original HTTPServer, file access, caching & keepAlive)
Christian Penk (ComSwiki layer, refactoring into Services)
<info@exept.de>
Doc $Revision: 1.11 $