Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Smalltalk on server without GUI?

I've got rather distinct question - I'd like to run Smalltalk on a production server without using graphical interface. Is this possible with VW or Pharo (maybe even Squeak)?

I've got a VPS hosting without X and would like to have few websites running on Smalltalk, while developing them locally with full-blown Smalltalk env, including GUI.

like image 970
Damir Horvat Avatar asked Mar 14 '10 18:03

Damir Horvat


2 Answers

Yes, it is possible to deploy Pharo in a "headless" way. Just send the -headless and that's all. Example:

#!/bin/sh

NOHUP="/usr/bin/nohup"
SQUEAK_VM="/usr/bin/squeakvm"
SQUEAK_OPTS="-mmap 100m -vm-sound-null -vm-display-X11 -headless"
SQUEAK="$SQUEAK_VM $SQUEAK_OPTS"
IMAGES_HOME="/home/miguel/squeak/images/azteca"
SCRIPTS_HOME="/home/miguel/squeak/scripts/azteca"
LOGS_HOME="/home/miguel/squeak/logs/azteca"
START_PORT=8080
END_PORT=8093


# Start the Magma image
echo "Starting Magma image"
$NOHUP $SQUEAK $IMAGES_HOME/magma.image $SCRIPTS_HOME/magma.st >> $LOGS_HOME/magma.nohup &

# Start the Seaside images
for PORT in `seq $START_PORT $END_PORT`; do
  echo "Starting Seaside image on port: $port"
  $NOHUP $SQUEAK $IMAGES_HOME/seaside.image $SCRIPTS_HOME/seaside.st
  port $PORT >> $LOGS_HOME/seaside.nohup &
done

It is common to deploy a PharoCore image running Seaside, with in headless mode and running RFBServer (remote buffer server) which is actually a VNC server. Then, you can connect to that image trough a VNC client and you can browse and use the Smalltalk image as if it were locally.

I suggest you to read

http://miguel.leugim.com.mx/index.php/2009/09/18/deploying-seaside-applications/

Or the new seaside book.

Cheers

like image 200
Mariano Martinez Peck Avatar answered Sep 23 '22 23:09

Mariano Martinez Peck


As answered in How is the Deployment in different Programming Languages?:

Smalltalk:
Deploying a Squeak or Pharo web application using Seaside and Apache httpd is described in the documentation, chapter Deployment with Apache.

like image 9
stesch Avatar answered Sep 22 '22 23:09

stesch