Archive for the ‘Uncategorized’ category

Creating a Seaside runtime image with Pharo

September 8, 2010

For the ec2 machine image with Seaside I prepared an image with only the runtime packages of Seaside. The image was based on PharoCore 1.1. This is the core Pharo image without development tools and extra libraries. The Seaside development tools can be very convenient during development but in a production environment they can be a serious security risk. You can disable them but the easiest and safest option is to not load these packages into your runtime image.

This is the recipe I used to setup the image:

1. Download the latest (stable) PharoCore

2. Load the Seaside 3.0 metacello configuration:

Gofer new
	squeaksource: 'MetacelloRepository';
	package: 'ConfigurationOfSeaside30';

3. Load the Seaside runtime packages we need

((Smalltalk at: #ConfigurationOfSeaside30 ) project latestVersion) 
	load: #( 'Base' 'Seaside-Adaptors-Comanche' 'JQuery-UI' 'Seaside-Examples').

4. Start the Komanche http server on port 8080

(WAComancheAdaptor port: 8080) start

5. Load the VNC Server (for remote image “management”)

Gofer new
	renggli: 'unsorted';
	package: 'RFB';

And finally I loaded my Seaside app and configured this app as the default app in Seaside.

"Load small demo Seaside app"
Gofer new
	squeaksource: 'Cloudfork';
	package: 'Cloudfork-EC2Demo';
"Make ec2demo the default Seaside app"
WAAdmin defaultDispatcher defaultName: 'ec2demo'.

This “lean-and-mean” Smalltalk image worked fine for me. I also exported the FileLibrary to the Linux file system so the static resources can be served by Apache directly. This is documented in the Deployment chapter of the Seaside book.

Update: Tip from Mariano Martinez Peck
You may want to evaluate a “ScriptLoader new cleanUpForProduction” after downloading PharoCore.
This will clean a lot of stuff and remove a lot of code (like tests) that may not be needed in production environments.


Get every new post delivered to your Inbox.