View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

How to Setup Comanche in Squeak 3.8

Team Robot Chicken

How to Setup Comanche in Squeak 3.8

Uploaded Image: RobotChicken.jpg
by: Amro Mousa, Elliott Clark, Brandon Reynolds, Jiasheng He




This tutorial intends to explain how to get the Comanche HTTP server working with
Squeak 3.8. It is recommended that you do this with a fresh install of Squeak,
however it should work at any time.

Step 1: Loading the Packages

In order to install the Comanche server packages, you'll need to use the package loader,
accessed from the World Menu by choosing "Open..." then selecting the "SqueakMap Package
Loader." (In previous versions of Squeak, this was listed as the Universe Browser)

You may be prompted to update the package loader; this is not necessary, so I recommend
choosing not to. From the package loader you opened, you'll need to install three packages:

DynamicBindings 1.2
KomServices 1.1
KomHttpServer 7.0.1

To install a package, scroll through the list in the upper left corner of the browser,
then click on the blue arrow next to the package name, and select the version listed above.
Right-click on the corresponding package version, and choose install. You may be prompted
with a message saying that the version has not been known to work with the current version
of Squeak, but we confirm that it does work, so choose Yes to continue. Please be sure to
install the packages in the order listed above, and with the versions described. This is
the only combination of packages we could get to work with Squeak 3.8. Follow the image
below to see how to access the packages.

Uploaded Image: KomServices.JPG


Step 2: Starting the Server

Once you've finished installing the packages, you're ready to start the server. You can
use the following code within a workspace or your own method to start the server. The
port listed here is 8080, you may change it as necessary.

	| ma |
	ma := ModuleAssembly core.
	ma serverRoot: FileDirectory default fullName.
	ma documentRoot: FileDirectory default fullName.
	ma directoryIndex: 'index.html index.htm'.
	ma serveFiles.
	(HttpService startOn: 8080 named: 'httpd') plug: ma rootModule

Step 3: Accessing the Server

In order to access the server you've started, simply open your web browser and enter into
the address bar: http://localhost:8080

(Note that if you change the port number when starting the server, you'll need to change
the above number to whatever the new port is)



Additional Things to Know

For Windows users, if the Windows Firewall is active, it may attempt to stop Squeak from
opening the port the server runs on. You should be able to choose to "Unblock" Squeak to
remedy this issue. Without doing so, the server may not run.

Also, you may run into an error saying that a server is already running on a port. In order
to kill all servers running, you may wish to have a method like the following available:

	TcpService services do: [ :a | 
		a portNumber = myport 
		ifTrue: [
			a stop 
		]
	].

This will terminate servers on every port, so you may wish to adjust it to close only the
ports you know are running.



This tutorial brought to you by: Team RobotChicken

Links to this Page