Using our services

Our next and final role is as the consumer, the owner of acme.com who wants to launch and run their Web site.

Our first step is to start a new launcher and connect to the DNS service. We issue some commands to manage our domain:


% launcher
Initialising Nodality...
launcher> connect acme-dns {warrant:acme-dns-warrant.xml}
launcher> acme-dns.addSubdomain www
launcher> webmaster=feedback@jtrix.org
launcher> acme-dns.issueWarrant www $webmaster AREC null null null
<<warrant>>
launcher> www-acme-warrant=$0
launcher> 

What we're doing here is creating another warrant. This one is for the HTTP service so it can talk to the DNS service. We don't want to give the warrant we just used, because we don't want to let the HTTP service manage our entire domain--we just want it to manage the www subdomain. So we've created a warrant which just allows it to manage the A records of that subdomain.

Our next step is to connect to the HTTP service. The details of what we do here are beyond the scope of this document, but briefly we just tell it that we'll need some disk resources:


launcher> connect http {warrant:acme-http-warrant.xml}
launcher> file-facet-reqs={!http.string_array:org.jtrix.facets1.util.io.IFileSystem}
launcher> file-properties-reqs={!http.propertyset:}
launcher> resource-reqs={!http.rrequirements:null}
launcher> http.findResources $file-facet-reqs $file-properties-reqs
<<object>>
launcher> resource-reqs=`http.addrequirements disk $0 $resource-reqs`
launcher> 

Next we connect to our Webtrix service and upload our WAR file:


launcher> connect webtrix {warrant:acme-webtrix-warrant.xml}
launcher> webtrix.uploadWar examples << examples.war
launcher> webtrix.addBackend /examples examples
launcher> backend=`webtrix.getBackendWarrant`
launcher> 

In uploading the WAR we've also told Webtrix that it should appear under the /examples hierarchy. We've also created a warrant to access it; this will be given to the HTTP service.

At this stage we've set up our DNS, primed our HTTP server and uploaded our servlet-based Web site.

Here's how we link them all together. The second command will take a long time to execute:


launcher> http.setDNSWarrant $www-acme-warrant
launcher> http.setListener $backend www.acme.com $resource-reqs
<<object>>
launcher> 

That second command takes a long time because a huge amount is going on. Among other things HTTP server needs to connect to Webtrix, which starts up Tomcat, loads the WAR files and starts up the site. Along the way several new netlets are started. But once that's done our Web site is up.

Here's how we find out what IP address www.acme.com is listening on (i.e. its A record). This was set in the DNS by the HTTP service, and we are connecting to the DNS service using the same warrant it used:


launcher> connect www-dns $www-acme-warrant
launcher> www-dns.getA www.acme.com
10.119.8.139
launcher> quit

% 

Nik Silver 2002-03-09