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,
compatibility code to support Comanche applications and new additional features for
performance, administration and ease of configuration.
Features are:
HTTPServer howToStart.
HTTPServer howToConfigure.
ComSwiki documentation found on Swiki-FAQ.
However, the server may also be started and configured programmatically,
by evaluating:
or:
HTTPServer startServer
HTTPServer startServerOnPort:aPortNumber
Notice, that under Unix, the HTTPServer cannot usually serve the default HTTP port (80), because this is a system port, which cannot be served by non-priviledged users (Windows, as usual, does not care much about priviledges).
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). Another secure approach is to have apache run as your primary server in the standard port, and use an FCGI connection to the ST/X server. That is also the setup we use on our own www.exept.de webserver.
Do not forget to enter the correct port number in the browser
(i.e. enter the URL "http://hostname:port/"
).
Late note:
On many systems, the 8080-port is also in use (by the zope webServer).
So you may want to use 9090, 8081 or 8088 (sigh).
Depending on which features were enabled in the settings dialog,
the default page includes links to demonstrate features of the server.
If you see an empty page or an error message in your webBrowser,
(re-)check your service settings in the launcher's webService settings dialog.
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).
Quick start:
Start the server on 8081:
|
|
HTTPService
or
HTTPActionService
and defining the minimum required protocol there.
The difference is that an HTTPService
is defined by at lease two URL-path components;
the first selects the service whereas the second is used as a message selector.
For protection, the message selector is validated by asking the service for its allowedMessages
.
In contrast to this, HTTPActionService
instances are always invoked via their process:
method (i.e. it has the freedom of simulating any document hierarchy below.
Typically, HTTPService
instances are better suited for RPC-like action calls
(parametrized by additional arguments after the 2nd URL component),
whereas HTTPActionService
instances are recommended if fileSystem hierarchies are to be
emulated.
STT examples are found in the "goodies/webServer/data
" directory.
Examples of subclasses of
HTTPService
and HTTPActionService
are found via the browser.
Makefiles and additional code for the standAlone server is found in the "projects/webServer
"-directory.
To build the standAlone webServer executable, enter (at the shell-command level):
After building, enter:
$ cd projects/webServer
$ make
for usage information.
$ webServer --help
Legally, it is a freeware or public domain goody, as specified in the goodies copyright notice (see the goodies source).
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.
don't forget to load your proxy and rewrite module, rewrite is used to handle some misplaced url's.
Notice from eXept: we did not validate the above information.
LoadModule proxy_module /usr/lib/apache/modules/libproxy.so
LoadModule rewrite_module /usr/lib/apache/modules/mod_rewrite.so
<VirtualHost>
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]
</VirtualHost>
Origin/Authors:
Squeak (PWS and ServerAction hierarchy))
Claus Gittinger (original HTTPServer, file access, cgi, caching & keepAlive)
Christian Penk (ComSwiki layer, refactoring into Services)
<info@exept.de>