Plesk 11 Upgrade Unable to run Perl scripts in cgi-bin

After an upgrade to Plesk 11, my Perl scripts located under cgi-bin/ for a specific domain were not executing properly. Requests generated HTTP response code 500 and my error logs showed the unhelpful message "Premature end of script headers" I verified all permissions and even disabled / re-enabled cgi-bin support through Plesk which installs a test script under cgi-bin/test/test.cgi Even the test script failed to run. It also generated the message "Premature end of script headers: test.cgi" I eventually resolved the issue with two changes:

  1. The domain's root folder in /var/www/vhosts was not owned by the domain user. So I fixed that with a chown command.
  2. Within the Plesk control panel, I had to disable "Perl" support and enable "CGI" support to get my perl scripts with the ".pl" extension to run under cgi-bin
Share Comments

Using iStat 2.x on Mountain Lion

Shawn Hooton wrote a piece on how to use iStat 2.x on Mountain Lion that I've used several times at this point. Linking to it here for posterity.
Share Comments

Moved to Blogger

I started this Agile Answers blog on jroller back in 2006 and I lost some of the older content in my move to Posterous. Sadly Twitter is killing Posterous so I've had to move again...this time to Google's Blogger. Alas - I've lost all the Posterous comments and a lot of formatting in the process. As if The Sean Cook working there weren't reason enough, I now have one more reason to hate Twitter.


Share Comments

Compressing MySQL client-server communication with Play Framework

FolderGrid provides a RESTful api that often services requests where over 90% of the entire response time is spent pulling data from a MySQL instance. I was recently working to reduce overall response time for some long running transactions in that bucket.

After optimizing my queries and my database caching - I looked at network transfer time from the dedicated MySQL server to the mysql client on the application server.  Simply enabling MySQL zlib compression resulted in a 3x performance boost for many of the larger resultsets. 

To configure your Play Framework connection pool to enable MySQL client-server zlib compression, you'll need to use the explicitly defined "db.url" instead of the shortcut "db" configuration key. Your key should look something like this:

db.url=jdbc:mysql://remotehost/dbname?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci&useCompression=true

 

 

Share Comments

When not to front your application with nginx HttpProxyModule

Throwing nginx (or Apache or lighthttpd) in front of other application stacks is so common that we often don't think twice about the possible costs. This bit me over the weekend when I casually threw up nginx for SSL termination and configured HttpProxyModule to proxy to my Play Framework driven application.

I failed to heed the first section in the HttpProxyModule docs. See that note about how "the entire client request will be buffered in nginx before being passed on to the backend proxied servers" ?

That's one note you are going to care about when you're handling large requests and can't figure out why your application is so slow to respond to them.

RTM 

 

 

Share Comments

Supporting multiple file upload runtimes with pupload inside ExtJS 4

The reference client I built for FolderGrid's API is a zero footprint web client created using ExtJS 4. I wanted to support drag & drop file uploads for advanced browsers but degrade nicely all the way back to IE6 for those poor lost souls stuck with tech from the last decade. So I integrated plupload and bound the two together with some jquery glue.

The results are working well in production and the client itself is open & licensed under GPL v3 per the terms of ExtJS 4. So if you are interested in copying & extending - have at it.

 

 

 

 

Share Comments

Automatically find trailing commas in your javascript project

These are simply updated instructions based upon the original Amaxus writeup here.

  • Install Rhino  (I used "port install rhino")
  • Grab the Rhinoized JSLint script here.
  • Create a script named checkForJsErrors.sh with the following two lines:

echo $1
rhino rhinoed_jslint.js $1 | fgrep -e 'Unexpected' --color=always 

  • Create an alias in your bashrc

alias checkjs='find . -name '''*.js''' -exec ~/bin/checkForJsErrors.sh {} ;'

Now when you execuate that alias in your project's root directory - all of your .js files will be scanned for trailing commas.

You're welcome.

 

Share Comments

orphanRemoval issues in Play Framework 'collection owner not associated with session'

I was just burned by an issue in Play Framework's JPA support of orphanRemovals. The issue manifests as a "collection owner not associated with session" JPAException within Play Framework 1.2.x  - it was supposed to be addressed in 1.2.5 with this patch, but I'm running 1.2.5 and am still running into it.

I didn't take the time to diagnose or file a report - for now I'm punting by restricting the use of 'orphanRemoval'.

Share Comments

Cautionary tale regarding cloud security

My work with FolderGrid has included quite a few very interesting technical problems that have resulted in material for this blog. I just posted an interesting read for anyone using cloud services to store or transport sensitive data. 

Share Comments

Compiling Maven project with JNLP API 1.6+ on Mac OS X

To compile a project using JNLP API with Maven you'll need javaws.jar in the compile-time classpath. You'll find the jar under the lib folder of your JDK installation. Mine was here:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar

 

Share Comments