Edit Rename Changes History Upload Download Back to Top

Using Silt with Runtime.im

VisualWorks includes web/runtime.im, a ready-built headless image for running a WebToolkit server. To use runtime.im, copy it to your image directory, and make a file runtime.cnf in that directory with one line:
Silt-Core.pcl
This will make Silt-Core be loaded automatically by the image at startup time, and reloaded when you use the Configure site's Manage Server | Reset Server. For that to work, you must have saved the parcel with Publish as Parcel, and without saving sources. You will also need to have Silt-Core's prerequisite parcels, and any others you need, in the standard parcel path.

To run Silt with my settings, I had to change the default port and virtual directory from runtime.im. The simplest way to do this is via the headless-startup.st file. If you're happy with the default 8008 or 2223 port, and have no virtual directory defined, and don't mind having the Shopping Demo present in a production server, you won't need this. Otherwise, place the text below in a file called headless-startup.st in your image directory.

"---
Startup actions for runtime.im to replace existing servers and demo app 
with our servers and app

Thanks to Mark Pirogovsky, vwnc 31.01.2005
---"

VisualWave.WaveRequestBroker allServers copy do: [:ea | ea deleteFromSystem] !

Parcel unloadParcelNamed: 'ShoppingDemo' !

ObjectMemory globalGarbageCollect !

(VisualWave.WaveHTTPRequestBroker newMinimal: 8009) 
	hostname: 'localhost'; 
	addDefaultResolvers; 
	virtualDirectories: (List with: 'blogs'); 
	trapErrors: true; 
	startRequest ! 

"This new server has been created after the logging channel registered itself with all servers, so need to register again"
VisualWave.WebConfigurationManager stopLogging; startLogging !

If your Silt process will be running behind a firewall, there's a couple of things to be aware of. Most Silt activity happens as normal HTTP with Silt as the server, so you'll need to allow Silt to be a server on port 80. When you post a blog entry though, Silt receives the entry as a server, but then also acts as an HTTP client to send a pingback to some central blog search engines, and also to any other blogs whose entries you referenced in your entry. To let it work as an HTTP client, you'll need to tell VW the appropriate proxy settings - the same as you tell Internet Explorer or any other HTTP client. You can specify these in the VW settings tool: create a user on the Net page, and on the Net/HTTP page tell it to use a proxy with that user and the appropriate settings. You can also save the changes for each page, merge them into one XML file, and add the following line to headless-startup.st to load this file:

VisualWorksSettings readFromFile: 'HTTPSettings.xml' asFilename. !

You probably want to get the server logs showing the time in the right time zone: the following line, adjusted as necessary, will do this. If you want VW to log more than the current rather spartan information, take a look at WebHitPrintPolicy in the open repository.

TimeZone setDefaultTimeZone: (TimeZone timeDifference: 2 DST: 1 start: 2 end: 3 from: 90 to: 304 startDay: #Sunday). !

It would also be a good idea to edit configure-site.ini, default-site.ini and your blog's APPKEY-site.ini to make them non-debuggable and only allow registered servlets. I'm not yet sure of the exact set of servlets needed, but my best guess is: Blog.AbstractServlet allSubclasses, Blog.ArchiveServlet, Blog.BloggerServlet, Blog.MetaBlogServlet, Blog.PingbackServlet. You might also need RedirectServlet and WebSiteFileServlet, maybe CheckAuthorizationServlet. Each should be specified on its own row at the end of the APPKEY-site.ini file. I find the x-servlet: format given in WebAppDevGuide.pdf gives an error, but the following format works:

ArchiveServlet = servlet/ArchiveServlet


Edit Rename Changes History Upload Download Back to Top