This toolkit was written by a guy down the road over in Chapel Hill, it seems. The idea seems to be to generate and configure MVC-structured PHP code with RESTful web access. Supports multiple apps with one installation. Works for me.

I grabbed the 0.20 release. It comes with a web-based front end that will mock up your initial application code. Unfortunately the javascript wasn’t working and it looked like it had a bad path to the embedded jquery library. Rather than kill myself researching, I switched to the git “edge” branch:

cd development/git
git clone http://github.com/recess/recess.git
  Initialized empty Git repository in /home/m/development/git/recess/.git/
git checkout master 
  Already on 'master'

Now it seems to be able to find its css and javascript.

Next problem was with mod_rewrite. It just wouldn’t work. Time to troubleshoot… and fixed. In Recess’ defense, this was probably the reason the 0.20 release didn’t work well.

Next, I went to create an app. I had to change the permissions on the apps directory, as instructed, since I unzipped recess under a group for which apache did not have write access.

Next, I cranked through a model for one of my apps. WOW, now I have a full set of “routes”, URL’s with which to RESTfully access my model. This is looking nice… to be continued…

mod_rewrite is essential if you’re going to write RESTful web services. Here are the steps I went through to troubleshoot my installation:

  1. Ensure you included mod_rewrite in your apache installation. For gentoo, you can use [eix www-servers/apache] – Gentoo’s apache2_modules_rewrite flag is enabled for apache, looks good.
  2. Test to see if it is being loaded. I created a dummy page phpinfo.php with the contents [<?php phpinfo(); ?>], to see what PHP had to say about it. Search for mod_rewrite – yep, there it is, good. If not, make sure it’s loaded in httpd.conf, the load line may be commented out.
  3. Now make sure it’s enabled for the path you’re using. The apache directive is [RewriteEngine On], and it has to be somewhere in your httpd.conf or an included file. In my case I use virtual hosts. According to Apache docs, I needed to add both of these to the top level of my virtual host directive:
    RewriteEngine On
    RewriteOptions Inherit
  4. The mod_rewrite rules I’m dealing with are all in .htaccess files. In that case you have to make sure you’ve turned on the switch that allows .htaccess files to override your settings. Basically, you’ll need [AllowOverride All] enabled for the path where you want to use .htaccess files.
  5. Finally, make sure your .htaccess settings and rules look good. Here’s an example I pulled from another good troubleshooting blog entry:
    cat .htaccess
     Options +FollowSymLinks
     RewriteEngine On
     RewriteRule ^alice.html$ bob.html
     RewriteRule ^bob.html$ alice.html

    It should force bob’s page to load when you request alice’s, and vice versa. Nice simple little test.

Once I went through this list, I was good to go.

UPDATE: I’ve needed this exact version of jpeg on other machines as well.  Looks like emacs is requiring an older package (v6) that gets removed when the newer package (v8) is installed.  Follow the instructions below to get the old version, which fixes emacs et al.

Somehow all of a sudden I’m missing the 64-bit libjpeg.so.62 library. Had to emerge this:

emerge =media-libs/jpeg-6b-r9 -av

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS   ] media-libs/jpeg-6b-r9 [7] 4 kB

Without it, emacs was unhappy, and broken emacs was causing a ton of other emerges to fail, for example git, with this error:

 * Compiling GNU Emacs Elisp files ...
/usr/bin/emacs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory