- Basic Smalltalk Dev Environment Concepts
- Installing Seaside, and Squeak/Pharo Basics (saving and exiting, basic navigation)
- “Setting It Up Right” – Loading Useful Extensions (Except it turns out, not really)
- Creating a Seaside “Hello World”, localhost
- Interlude: Getting a Remote Server
- Packaging Your Seaside Image for Deployment
- Installing Pharo on the Server
- Closing the Loop – Deployed Pharo Hello World On Your Domain
Step 1: Set up your hosting server / OS – Ubuntu 12.04 LTS x64
With this host, you select your operating system up front, and they create it from a ready image in a very short amount of time (with my previous host, it booted up to “bare” hardware with an Ubuntu install CD in the emulated disk drive, and so installation took a while).
OS-wise, I went with Ubuntu 12.04 LTS x64. Ubuntu because of familiarity and ease of dev tool installation, 12.04 LTS (Long Term Support) for its mix of newness, stability and long term security patch support, and the 64-bit version because the Riak db only runs on 64 bit systems, and that’s what I want to use for my Smalltalk persistence layer (via the Phriak library).
I’m pretty sure you can make all of this work on CentOS / RedHat, but I’m less familiar with those distros, and plus going with Ubuntu meant I could make use of the nice pre-packaged Pharo VMs, as you’ll see below.
Step 2: Install the Pharo VM
There are several ways of installing Pharo on a Linux server — see the Installing Pharo in Many Flavors post for a discussion.
apt-get install method on Ubuntu is the most straightforward for beginners. (A huge Thank You to Damien Cassou and Nicolas Petton for making available the Pharo Ubuntu packages! These make server-side installation much easier.)
For instructions, I went with the recommendations from the Pharo on Ubuntu guide.
sudo apt-get install python-software-properties
Add the Pharo PPA (custom package archive):
sudo add-apt-repository ppa:pharo/stable
sudo apt-get update
Install the server-side version of Pharo. (Meaning, only
pharo-vm-core, not the
sudo apt-get install pharo-vm-core
You can see all of the files installed by
sudo dpkg -L pharo-vm-core:i386
The binary that you will be executing will be in:
Note: -nox means “No X Windows”. Meaning, this is a server-side pharo, without any GUI components.
Also, you can view the help files from the command line:
Step 3: Upload Your Seaside Image
Now that Pharo is ready to go on your server, it’s time to upload your deployment image.
First, locate your deployment image on your development machine.
On Mac OS X, the image is located in:
[Seaside install/download folder]/Seaside-3.0.7.app/Contents/Resources
Copy the image to the server using scp. For example, I would use:
scp ~/Seaside-3.0.7.app/Contents/Resources/Seaside.1.image email@example.com:/home/my-username/
Step 4: Start Pharo
Finally, to launch the Pharo VM and point it to your image:
This will load the image from my user home, and start the Seaside web stack listening on port 8080, by default.
Of course, this is merely the basic concept of launching Pharo, for tutorial purposes. For a production application you would want to ensure that Pharo is started via a system service. In addition, you would want to put a web server such as Apache or Nginx in front of it, for security and load balancing purposes.