919 - 926 - 9847

FarCry 6.x tip of the day

I ran into an issue yesterday that I've not seen before.  I was greated with "fuName" doesn't exist in struct (blah,blah,blah) when editing an object in the webtop.  This object had been edited within the last few days, and I know that I had pushed up a new property to that object name "fuName", but it shouldn't have been an issue.  Editing a random object in the same worked fine, but it was just this one object. 

I reinitialized the application, I cleared all my cache.  I restarted the J2EE service, and apache.  I cleared out over cache folder I could find, but nothing worked.  It was until I started breaking everything out line by line from the error trace that it became apparent that the system was seeing a cached version of the object "somewhere".  That somewhere turned out to be dmWizard. 

So, it appears the dmWizard object holds a cached version of what your working on... but I've not really dug into "why".  Regardless, it was a pretty simple fix, but not simple to find.  If you should ever see the same situation as above, just clear out all the entries in dmWizard and you should be good to go!

How to configure a kick ass development setup - day 4

On our plate today, we'll be installing Apache.  I'm using the 2.2.x branch.

  • Go and grab your .msi, I'd recommend the one with OpenSSL included.  http://httpd.apache.org/download.cgi#apache22
  • Install Apache to c:\cf_dev\apache.  You'll need to choose "custom install" to change the directory. The other values can be left at default.
  • Get CF9 hooked up to Apache, Start-> All Programs-> Adobe-> CF9 xxxx-> Web Server Configuration Tool
  • Click Add... to create a new connector
  • Choose the CFusion instance and select Apache as your web server.  You'll need to pick out the configuration directory (c:\cf_dev\apache\conf) and the binary object (c:\cf_dev\apache\bin\httpd.exe) and check "install CF9 services".
  • Edit c:\cf_dev\apache\conf\httpd.conf and add at the bottom (the include pulls in any files we add to dev folder):
    #Turn on virtualhosts
    NameVirtualHost *:80
    NameVirtualHost *:443

    Include c:/cf_dev/apache/conf/dev/*.conf

    <Files ~ ".hbmxml$">
    Order allow,deny
    Deny from all
    </Files>
  • Find DirectoryIndex in the httpd.conf file, and add index.cfm to it.
  • Create a new site vhost file, we'll start with site1 (from back on day 1).  Create it as c:\cf_dev\apache\conf\dev\site1.conf
  • Fill it like so:
    #site1
    <VirtualHost *:80>
    <Directory "C:\cf_dev\projects\site1">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

    alias /CFIDE C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\CFIDE
    alias /cfide C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\CFIDE

     # JRun Settings
    <IfModule mod_jrun22.c>
        JRunConfig Verbose false
        JRunConfig Apialloc false
        JRunConfig Ignoresuffixmap false
        JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store"
        JRunConfig Bootstrap 127.0.0.1:51020
        AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
    </IfModule>   

     DocumentRoot "C:\cf_dev\projects\site1"
     ServerName site1.local
     ServerAdmin contact@localhost
    </VirtualHost>
  • Note, you should now remove all but LoadModule jrun_module "C:/JRun4/lib/wsconfig/1/mod_jrun22.so" from c:\cf_dev\apache\conf\httpd.conf.  This will allow us to use multiple J2EE engines under the same apache config.
  • Edit http.conf, and uncomment:
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  • Create a Railo based site for Site2 (follow the steps found on day one to first create the site2 project), fill the c:\cf_dev\apache\conf\dev\site2.conf with (we use proxypass to hand of CFM requests):
    #site2
    <VirtualHost *:80>
    <Directory "C:/cf_dev/projects/site2">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

    <Proxy *>
                Allow from 127.0.0.1
        </Proxy>

    ProxyPreserveHost On
    ProxyPassMatch  ^/(.+\.cf[cm])(/.*)?$  ajp://localhost:8009/$1$2

     DocumentRoot "C:/cf_dev/projects/site"
     ServerName site2.local
     ServerAdmin contact@localhost
    </VirtualHost>
  • To make Tomcat aware of server, we need to add this just before the </engine> tag at the end of c:\cf_dev\tomcat6\conf\server.xml.  It seems like duplication, but it just MUST be done:
    <Host name="site2.local" appBase="webapps" unpackWARs="false" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
              <Context path="" docBase="C:/cf_dev/projects/site2" />
        </Host>
  • Edit your hosts file (mine is at C:\Windows\System32\drivers\etc\hosts) to locally route our requests to the correct place.
    127.0.0.1 site1.local
    127.0.0.1 site2.local

How to configure a kick ass development setup - day 3

Today, we'll deploy Railo on Tomcat 6.  Note, I'm doing this the "hard way".  Jorden, from viviotek, created a handy dandy installer.  But, I rather like to install this stuff by hand so I can know what to fix should it break.  Pretty much all of this info is gleaned from Sean Corfield and his blog about installing various bits and pieces.  You can find it here.

  • Grab Tomcat 6 from http://tomcat.apache.org/download-60.cgi. I used the Core:32-bit windows zip
  • Edit your JAVA_HOME environment variable to point to c:\cf_dev\<jdk you downloaded previously>
  • Unzip it to c:\cf_dev and rename the folder to tomcat6
  • Go grab the Railo JAR files from http://www.getrailo.org/index.cfm/download/.  
  • Unzip these files to c:\cf_dev\tomcat6\railo
  • Open up c:\cf_dev\tomcat6\conf\catalina.properties and find common.loader=.  Add ${catalina.home}/railo,${catalina.home}/railo/*.jar to that line.
  • Open up c:\cf_dev\tomcat6\conf\web.xml At the end of the servlet section, just before the servlet-mapping section, add the following:
    <servlet>
       <servlet-name>RailoCFMLServlet</servlet-name>
       <description>CFML runtime Engine</description>
       <servlet-class>railo.loader.servlet.CFMLServlet</servlet-class>
       <init-param>
    <param-name>configuration</param-name>
    <param-value>/WEB-INF/railo</param-value>
    <description>Configuration directory</description>
    </init-param>  
       <!-- init-param>
    <param-name>railo-server-root</param-name>
    <param-value>.</param-value>
    <description>directory where railo root directory is stored</description>
    </init-param -->
       <load-on-startup>1</load-on-startup>
    </servlet>  
    <servlet>
       <servlet-name>RailoAMFServlet</servlet-name>
       <description>AMF Servlet for flash remoting</description>
       <servlet-class>railo.loader.servlet.AMFServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
    </servlet>  
    <servlet>
       <servlet-name>RailoFileServlet</servlet-name>
       <description>File Servlet for simple files</description>
       <servlet-class>railo.loader.servlet.FileServlet</servlet-class>
       <load-on-startup>2</load-on-startup>
    </servlet>
  • At the end of the servlet-mapping section, just before the filter section, add the following:
    <servlet-mapping>
       <servlet-name>RailoCFMLServlet</servlet-name>
       <url-pattern>*.cfm</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <servlet-name>RailoCFMLServlet</servlet-name>
       <url-pattern>*.cfml</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <servlet-name>RailoCFMLServlet</servlet-name>
       <url-pattern>*.cfc</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <servlet-name>RailoAMFServlet</servlet-name>
       <url-pattern>/flashservices/gateway/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <!-- could be RailoFileServlet -->
       <servlet-name>default</servlet-name>
       <url-pattern>/</url-pattern>
    </servlet-mapping>
  • At end of the file, add index.cfmto the list of "welcome files".
  • Open a command prompt, and run c:\cf_dev\tomcat\service.bat install to create a handy windows service

That's it!  We now have Tomcat + Railo rolling on our machine.  We're still missing the site definition, but that's a task we'll handle after we have Apache up and running.

New Railo plans and pricing

Crazy, crazy world out there.  It looks like I may get a green flag to have my company, Geodesic GraFX, on the community page at getrailo.org.  I wouldn't be hosting today without a great open source product like Railo, and I'm flattered to be given a chance to have my name out there as a recommended host.

Quckie Railo/Apache Alias tip

I've not run into this issue in Adobe CF+Apache, but it happens to me with Resin/Railo+Apache. 

If you use Apache Aliases, and expect to be able to serve CFML templates through them, and you're using Railo, you're going to need to also make a Railo mapping.  So, for an alias like:

Alias /myadmin <projectpath>/<somefolder>

You'll also need to log into your Railo admin for the context, and create a mapping

You do development on Apache+Tomcat+Railo+Adobe CF+Resin+etc

So let's say you support multiple customers, and a mix of Adobe ColdFusion, Railo, and multitudes of J2EE servers.  You want to remain true to the environment you're developing against, so you end up installing all the pieces to make that happen.  At one point, I had ACF 6.x - 8.x installed on my laptop, but for now I just need ACF 9.x and Railo+Resin or Tomcat.

I like to pipe everything through Apache.  I realize that most modern J2EE engines can handle tons of traffic, most still cannot (easily) match the power of mod_rewrite and Apache.

I won't be detailing how you install ACF, or Apache, etc in this post.  I do plan on doing so at some point down the line, but it won't be this post.

Firstly, in your httpd.conf, we set up our Resin/ACF DLLs.


LoadModule jrun_module "<JRUNpath>/lib/wsconfig/1/mod_jrun22.so"
LoadModule caucho_module "<railopath>/win32/apache-2.2/mod_caucho.dll"

Next, make a directory to hold your Apache virtual hosts configs and add this nifty line to your httpd.conf.  Note, this is the windows syntax.  You don't need the *.conf in *nix for whatever reason.


Include <apachepath>/conf/mysites/*.conf

Make a site1.conf in the mysites folder, and this is what it would look like for ACF.


<VirtualHost *:80>
<Directory "<projectpath>\site1">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

alias /CFIDE C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\CFIDE
alias /cfide C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\CFIDE

# JRun Settings
<IfModule mod_jrun22.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51020
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>



DocumentRoot "<projectpath>\site1"
ServerName site1.local
ServerAdmin contact@localhost
ErrorLog <projectpath>\site1\apache_logs\error.log
TransferLog <projectpath>\site1\apache_logs\access.log
</VirtualHost>

For Resin+Railo, it'd look like this for site2.conf


<VirtualHost *:80>
<Directory "<projectpath>\site2">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

ResinConfigServer localhost 6800
<Location /caucho-status>
SetHandler caucho-status
</Location>



DocumentRoot "<projectpath>\site2"
ServerName site2.local
ServerAdmin contact@localhost
ErrorLog <projectpath>\site2\apache_logs\error.log
TransferLog <projectpath>\site2\apache_logs\access.log
</VirtualHost>

For our last example, site3.conf, we'll use Tomcat+Railo


<VirtualHost *:80>
<Directory "<projectpath>\site3">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

<Proxy *>
Allow from 127.0.0.1
</Proxy>

ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2

DocumentRoot "<projectpath>\site3"
ServerName site3.local
ServerAdmin contact@localhost
ErrorLog <projectpath>\site3\apache_logs\error.log
TransferLog <projectpath>\site3\apache_logs\access.log
</VirtualHost>

Cool, I'm a Railo case study!

I'd like to thank AJ Mercry for the push to submit my story, Gert Franz and Micha for offering the platform, and the Railo community for helping me sort out issues the last few years.

Without Railo, I'd not be able to have the server offerings that exist today.  That's not a kang on Adobe ColdFusion, merely saying that without open source tools (apache/mysql/eclipse/subversion), I'd have to charge much higher prices, and shove more clients on a server just to break even.

Thank you Railo community, I can't wait for the goodies coming down the pipe!

Link to the case study is here

GoDaddy drops (shared) ColdFusion support

For whatever reason I only saw this yesterday, but it looks like GoDaddy is dropping out of the CF arena.

I would like to help some of these lost souls out. In the next few weeks, I'm going to put together a server offering with a free 30 day trial just for GoDaddy customers that would like to see if Railo will meet their needs. I don't have all the details formulated yet, but it will include 500 Megs storage, 1 domain, email, etc. I don't yet have the capital together to transfer domains to my own services, but re-pointing to my NS servers will get the job done.

If there's any GoDaddy users ready to just jump ship, before I get the promotion together, you can always hit up my contact link.

FarCry: admin redirect for Railo, and error handler update

So, first item of business. The /farcry/core/webtop folder for FarCry is a real pain to remember, and clients loath having to type that out all the time. To get around this, you're going to need to make the following edits. NOTE: This assumes that you have Apache, rewriting enabled and Railo as your CFML engine. It can be easily adapted to other engines and webservers.

You'll need to open up the webroot/farcryConstructor.cfm file first.


<!--- find this --->
<cfset THIS.webtopURL = "/farcry/core/webtop" />

<!--- change to this --->
<cfset THIS.webtopURL = "/cmsadmin" />

Next, we're going to add an Alias to our web server. You'll need to adjust this if you're using IIS


Alias /cmsadmin "C:\<sitehomes>\<myproject>\farcry\core\webtop"

Our last step is going to be a CFML mapping. In Railo, you visit your http://site/railo-context/admin/web.cfm. Go to the mappings link, and add a resource for /cmsadmin and C:\\\farcry\core\webtop. If it doesn't exist, you'll see a nice red tinge to the box that you entered the path into.

Update your FarCry application, or restart your CFML engine

Bob's your uncle, you should now be able to now browse http://site/cmsadmin and see the FarCry admin!

Second order of business, dealing with the default error handling. It's really great to see what's going when something breaks, it's really BAD for other people to see this in production. It's pretty simple to resolve. The below code will still allow for you to see errors when running test locally, but send all server based errors to email.

Find your webroot/Application.cfc and make the following edit


<!--- find this --->
<cfset super.OnError(argumentCollection=arguments) />

<!--- replace with --->
<cfset var machineName = createObject("java", "java.net.InetAddress").localhost.getHostName() />
        <cfif machinename contains("<server name... use cgi variable to get this>")>
            
            <cfmail from="<valid mail>" to="<valid mail>" subject="ERROR - <sitename>" type="html">
            <cfdump var="#url#">
            <cfdump var="#session#">
            <cfdump var="#arguments#">
            </cfmail>
<!--- send to an error page... need to make this--->
            <cflocation url="/site-error" addtoken="false">
        <cfelse>
            <cfset super.OnError(argumentCollection=arguments) />
        </cfif>    

Might be the newest Railo case study

May wonders never cease. AJ Mercer and I were having a chat about FarCry, and the conversation turned to Railo hosting. I did catch the post from Sean about needing more marketing by us (the people in the trenches), but didn't really think myself a candidate for this. But, AJ pointed out it'd make for a good case study.

So, I've submitted my information to Gert, and I guess we'll see if it shows up on the case study page. I haven't look over the sites we host in awhile, but it surprised me to see it's up to 30+ as of now. It truly wouldn't be possible, at least on a VPS plan such as those that linode.com offers, without a great product like Railo. Way to go, team Railo, I eagerly await Railo 4.0!

More Entries