Setting up Lasso 9 beta with Subversion on OS X

A short guide compiled by Richard Taubo

Background:

I created this sheet when installing Lasso 9 via the new Subversion method on OS X in place of using a click-and-install package. Subversion allows the developer to obtain releases sooner without waiting for the installer packages to be built, and it avoids going through the hassle of downloading and installing packages.

I decided to install lasso9_beta in /Applications/. The full path after you have installed lasso9_beta trough Subversion becomes:

/Applications/lasso9_beta

These instructions are based on this filepath.

For an editor, I use nano in the Terminal, but you can use BBEdit or any other text editor. To save a file in then exit from nano, press "CTRL-X", then press "Y", then "ENTER" key.

When you have downloaded lasso9_beta as described, read the file "README-IMPORTANT.txt", even though these instructions should be sufficient to get you going.

Lastly: Don't blame me if your system gets hiccups after following these instructions! :-)

Delete any existing Lasso 9 installation

Only for those who have installed Lasso 9 previously.

sudo rm -R /Library/Frameworks/Lasso9.framework
sudo rm /usr/local/bin/lasso*
sudo rm -R "/Library/Application Support/Lasso 9"
sudo rm -R "/Library/Receipts/Lasso 9"*

Install Lasso 9 from the Subversion repository

cd /Applications/
svn co http://download.lassosoft.com/svn/lasso/lasso9_beta/trunk lasso9_beta
cd lasso9_beta

Use Subversion to update Lasso 9

Use Subversion to update your copy of Lasso 9 Beta to the latest version.

cd /Applications/lasso9_beta/
svn update

Update your user profile

Add the LASSO9_HOME environment variable to your user profile.

nano -S ~/.bash_profile

and at the end of this file add:

export LASSO9_HOME="/Applications/lasso9_beta"

Save and close your profile.

Rehash the LASSO9_HOME environment variable so it becomes available immediately without restarting the terminal.

source ~/.bash_profile

Check that the LASSO9_HOME environment variable is set.

echo $LASSO9_HOME

-> /Applications/lasso9_beta

Install dependencies in Finder

Run the Lasso9Dependencies installer, as referred to by the instructions in

/Applications/lasso9_beta/README-IMPORTANT.txt

If you have not done so already, unzip the following.

/Applications/lasso9_beta/Installers/Lasso9Dependencies.osx.pkg.zip

Then double-click to run the Lasso9Dependencies installer.

These dependencies do not change often, so you should only have to run it once, unless you hear otherwise.

Make links between the Lasso 9 frameworks

See the README-IMPORTANT.txt.

Next, in a terminal, cd into the Installers directory and run the "./makelinks" command. This will create a link to the Lasso9.framework directory into your ~/Library/Frameworks/ directory.

You will only have to do this once, unless you change the path to the Lasso 9 home folder, in which case just run the makelinks command again:

cd /Applications/lasso9_beta/Installers
./makelinks

Create links to new lasso9 and lassoserver

Optionally you can add links to the LassoExecutables/lasso9 and LassoExecutables/lassoserver commands into /usr/local/bin. This will let you execute these commands from any location.

cd /usr/local/bin
sudo ln -s /Applications/lasso9_beta/LassoExecutables/lasso9 .
sudo ln -s /Applications/lasso9_beta/LassoExecutables/lassoserver .

Test the installation

from README-IMPORTANT.txt

In a terminal, cd into the LassoExecutables directory. Test the lasso9 command by having it print out the date

cd /Applications/lasso9_beta/LassoExecutables
echo 'date' | ./lasso9 --

If things are configured properly, you should see the date printed in response.

Configure Apache2

Open your Apache2 .conf file.

sudo nano -S /private/etc/apache2/httpd.conf

At the end, if not added already present, add the following.

Include /private/etc/apache2/users/*.conf

Save the file.

Move the Apache .conf file for Lasso9 from the SVN directory to the apache2 users directory.

sudo mv /Applications/lasso9_beta/Installers/lasso9.apache2.conf  /private/etc/apache2/users/
// all one line

Starting and Stopping Lasso 9

Lasso 9 can be started by two methods. Apache can automatically start Lasso 9 in FastCGI mode, or you can start Lasso 9 from the command line.

Starting Lasso 9 automatically via Apache

Configure Apache to start Lasso 9

lasso9.apache2.conf includes a line that starts lasso9 directly whenever Apache2 is started or restarted. Edit the following file.

sudo nano /private/etc/apache2/users/lasso9.apache2.conf

The line is:

FastCGIServer /usr/local/bin/lassoserver -initial-env LASSOSERVER_FASTCGIPORT=8999
// all one line

If you want to restart lasso9 and this line is uncommented, you must stop lasso9 before you can start it again.

Change the lassoserver executable to have setuid

Apache can only start the process as the www user, which is useless. Go in and change the lassoserver executable so that it is setuid. This makes the lassoserver process under which Apache starts to run as you (or whoever the owner of the lassoserver executable is). In the terminal, issue the following.

chmod u+s /Applications/Lasso9_beta/LassoExecutables/lassoserver

Check Apache configuration

To test that you've got it right, first check your configuration by typing the following.

sudo apachectl configtest

You will be asked for your password. If the Apache configuration is correct you'll get a message saying so.

Start Apache (and optionally Lasso automatically)

To restart Apache, which in turn should start Lasso automatically.

sudo apachectl graceful

Starting Lasso 9 via the command line

Start the web part of lasso9.

/Applications/lasso9_beta/LassoExecutables/lassoserver

Stop the web part of Lasso 9

Either use the following command.

killall lassoserver

Or find the process that comes up, and then kill it.

top -l 1 | grep 'lassoserver'
sudo kill "theNumberThatComesUp"

Open the following URL in a web browser.

http://localhost/lasso9/Admin/

Good Luck,
Richard Taubo

(With minor alterations by Jolle Carlestam. See the page history for other contributors.)

Troubleshooting

Common problems and their solutions.

Can't Get Apache to Start lassoserver

There are various reasons this might be. The first thing to do is check that you can start lassoserver manually from the terminal. Issue the following command to start lassoserver with troubleshooting information (replacing "/path/to/" with the correct path to the lassoserver executable):

env LASSO9_PRINT_FAILURES=1 /path/to/lassoserver

If you can start lassoserver from a terminal, but Apache still has problems, check your Apache error_log to see what sort of diagnostic information it may display. Below are log entries and possible solutions.

This is usually a permissions error, the server is running under _www instead of root. To fix this run the following command (replacing "/Lasso9/Home/" with the path to your Lasso9 directory):
sudo chmod u+s /Lasso9/Home/LassoExecutables/lassoserver
This is a permissions issue for where Apache is trying to create the fastcgi socket ("/opt/local/apache2/logs/fastcgi/" in the above log). Verify that all the permissions are set correctly so that the apache user (_www on Mac OS X 10.5 and higher) has access to that folder and write access for that folder. If the Unix permissions are all correct and you are still having problems, it is most likely an issue with Access Control Lists (ACLs). To check for ACLs, using the example above, I would do "ls -l /opt/local/apache2/logs"
drwx------+  4 _www  _www       136 Oct 30 16:38 fastcgi
If you notice the plus sign at the end of the permissions list, that means there are ACLs imposed. To get rid of the ACLs on that folder issue the following command:
sudo echo | sudo chmod -R -E /opt/local/apache2/logs/fastcgi
Note, if you notice ACLs all the way up the chain and want to get rid of them you can issue the following command:
sudo echo | sudo chmod -R -E /opt