title: Adobe Flex Apache module under Linux
body: <p>I'm attempting to use the Adobe Flex Apache (2.2) module under Linux from here - <a href="http://labs.adobe.com/wiki/index.php/Flex_Module_for_Apache_and_IIS" rel="nofollow noreferrer"><code>http://labs.adobe.com/wiki/index.php/Flex_Module_for_Apache_and_IIS</code></a> (the manual install). I have a perfectly working Apache system, with Ubuntu 8.10 and the Sun JDK v6 update 10 so installing this is not about support tools.</p>
  
  <p><strong>I can't figure out how to make this apache module work.</strong></p>
  
  <p>My <code>httpd.conf</code> shows this:</p>
  
  <pre><code>LoadModule flex_module /usr/lib/apache2/modules/mod_flex.so
  AddHandler flex .mxml
  </code></pre>
  
  <p>The mod_flex.so is in the right place.</p>
  
  <p>I have /usr/bin/compiler.sh:</p>
  
  <pre><code>#!/bin/sh
  java  -Djava.awt.headless=true -ms128M -mx256M -jar "/home/jamie/Adobe_Flex_Builder_Linux/flexc.jar" ${*} 2&gt;&amp;1
  </code></pre>
  
  <p>(why on earth would you hardcode the location of this?). This shell script gets executed (e.g. if I put a <code>echo "hi!" &gt;&gt; /tmp/log.txt</code>, it shows up).</p>
  
  <p>But, it just returns to the browser a blank page. So the module is doing something, it just ain't doing it correctly.</p>
  
  <p>The compiler configuration file (which I've put in the same directory as compiler.sh, as the flexc.jar and as the .mxml file being compiled references:</p>
  
  <pre><code>flex_config=/home/jamie/Adobe_Flex_Builder_Linux/sdks/3.0.0/frameworks/flex-config.xml
  flex_lib=/home/jamie/Adobe_Flex_Builder_Linux/sdks/3.0.0/frameworks
  </code></pre>
  
  <p>Now, sometimes I manage to get error output into the browser - it complains about not being able to find the class flash.localization.ILocalizer.</p>
  
  <p>I've managed to squash that error by editing the manifest in flexc.jar to point to the necessary jar files from the 3.0.0 Flex SDK from Adobe (I did try and set the CLASSPATH environment variable to point to the necessary jars, but that didn't work) Now, my latest error is:</p>
  
  <p>An error occured on the server. Server error is: 'Error occurred in server thread; nested exception is: java.lang.NoClassDefFoundError: flex2/linker/SimpleMovie' </p>
  
  <p>This shows up in a nicely formatted "Compilation Results" page in the browser, so obviously now I've got the compiler trying to compile the mxml, and failing because it's missing mxmlc.jar. Adding mxmlc.jar to the flexc.jar manifest has not helped this last problem.</p>
  
  <p>Any help appreciated!</p>