How To Install the Axiom Stack on Joyent Accelerators
What is Axiom Stack
The Axiom Stack is an open source (AGPL) web application framework. The Axiom Stack is a number of things wrapped in one package. It blends Java, which is at its core, with server-side JavaScript and a number of other technologies into a single platform.
Application Development
Applications written for Axiom Stack are run server-side using the Mozilla Rhino ECMAScript engine. Application development in Axiom Stack is done with a mix of JavaScript and Java, and uses TALE for the presentation layer. Use of language features up to ECMAScript 1.7 are supported: for example, E4X providing XML manipulation and list comprehensions like those found in the Python programming language.
Templates
Presentation templates are built using TALE, which uses E4X. This keeps the presentation and business logic separate. TALE consists of of handful of directives that allow looping over arrays to inclusion of other templates.
Business Logic
Making use of Rhino we create a layer for business logic that can be created with either JavaScript or Java. The harmonious bond between the two foster rapid and clean development. Plus, it affords a lower barrier of entry.
Under the Hood
Axiom Stack is forked from Helma. Axiom Stack uses an object-oriented database as its primary storage rather than a traditional relational database. All data stored in an application is surfaced as ECMAScript objects. Object persistence is largely transparent to the application developer. The default storage is maintained in Lucene. Objects may also be mapped to a new or existing relational database. The database structure needs to be created prior to mapping. The only requirement is that the database has a JDBC connector.
Axiom Stack On Joyent
Deploying Axiom Stack on Joyent is fairly simple. Follow these steps and you'll have an blog in place in no time! We are also working on creating a package for easier deployment on Joyent Accelerators.
- Download The Stack - http://www.axiomstack.com/download/
wget http://file.axiomstack.com/public-bzr/releases/axiom-stack-3.2.6.zip
- Unpack The Stack - We recommend /opt/local/axiom-stack
unzip axiom-stack-3.2.6.zip; sudo mv stack-trunk /opt/local/axiom-stack
- Setup file modes
sudo chmod +x /opt/local/axiom-stack/start.sh
At this point you have to decide:
- Start The Stack from the shell?
sudo /opt/local/axiom-stack/start.sh
- Start The Stack using SMF
Using SMF
- Create a script to start Axiom Stack. The reason for using a second file is that you cannot use a lone ampersand in the XML for the manifest file. We'll call this file “svc_start.sh” and put it in /opt/local/axiom-stack/. The file looks like:
#!/bin/bash
case $1 in
# SMF arguments (start)
'start')
/opt/local/axiom-stack/start.sh &
;;
*)
echo "Usage: $0 { start }"
exit 1
;;
esac
exit $?
- Create the manifest file. We'll call this file “axiom_svc.xml” and put it in /opt/local/axiom-stack/. The file looks something similar to the following.
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="Axiom Stack">
<service name="application/axiom-stack" type="service" version="1">
<dependency name="filesystem" grouping="require_all" restart_on="none" type="service">
<service_fmri value="svc:/system/filesystem/local"/>
</dependency>
<exec_method type="method" name="start" exec="/opt/local/axiom-stack/svc_start.sh %m" timeout_seconds="60"/>
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
<instance name="default" enabled="true"/>
<template>
<common_name>
<loctext xml:lang="Java">
Axiom Stack
</loctext>
</common_name>
</template>
</service>
</service_bundle>
- Import the manifest into the SMF manager. From the command line, type:
sudo svccfg import /opt/local/axiom-stack/axiom_svc.xml
- Start the service. From the command line, type:
sudo svcadm enable axiom-stack
Notes
- Axiom Stack 3.2.6 and earlier have a dependency on ImageMagick. This generally comes installed on Joyent Accelerators, but if not, you should be able to add it using pkg_add.
- We're putting together a pkgsrc to ease your deployment. For now, the above should suffice.
