Friday, March 7, 2008

Flex Module for Apache & Installing Flex SDK

Steps to install flex module for apache on linux.
-------------------------------------------------

Pre-requisities

1. Flex SDK 2.0.1 or later (can download from http://download.macromedia.com/pub/flex/sdk/flex2_sdk_hf1.zip)
2. JRE 1.4.2 or later (can download a self extracting jre file and install)
3. Java enabled browser
$cd /plugins
$ln -s /plugins/i386/ns7/libjavaplugin_oji.so
Restart firefox

Installing Flex-SDK
1. unzip the downloaded flex_sdk_hf1.zip
$unzip flex_sdk_hf1.zip
2. cd fles_sdk/bin
3. chmod 777 mxmlc
4. vi mxmlc
On line 34 change "java $VMARGS -jar "$FLEX_HOME/lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" $*" to "_INSTALLED_DIR>/bin/java $VMARGS -jar "$FLEX_HOME/lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" $*"

Installing Flex module for apache
1. Download flex module for apache(http://download.macromedia.com/pub/labs/flex_mod_apache/flex_module_manual_install_050107.
zip)
2. unzip flex_module_manual_install_050107.zip
$unzip flex_module_manual_install_050107.zip
3. Inside the /usr/bin folder create a new file named compiler.sh and add (a copy of this in dir)
#!/bin/sh
java -Djava.awt.headless=true -ms128M -mx256M -jar "//flexc.jar" ${*}
4. grant execution permissions on the compiler.sh file.
$ chmod 777 /usr/bin/compiler.sh
5. Open the Apache configuration file (httpd.conf) and add the following
LoadModule flex_module /modules/apache///mod_flex.so
AddHandler flex .mxml
6. configuring the compiler.conf
set the path to flex-config.xml (flex_config=/frameworks/flex-config.xml)
set the path to fles lib (flex_lib=/frameworks)
7. Restart apache server

Note: To compile .mxml file use mxmlc -o .swf .mxml