You learn something new every day!

I had to complete a disaster recovery project this week. We do this annually for one of our clients (yay for preparedness!) for one of their ColdFusion sites. I've got a run book and all that and was prepared to reinstall ColdFusion and copy in their EAR to redeploy the application. Until I had a conversation with a coworker: Him> Did they restore your data yet? Me> Yep, I'm just getting ready to reinstall ColdFusion and- Him> Re-install? Isn't everything already there? Me> Well, yeah, but. Wait... huh. I bet I could just run the jrunsvc command, and..

So it turns out, if you don't need search, .NET, LiveCycle or ODBC services, you can just restore ColdFusion from a a backup to your file system. All you really need (minus those other pieces) is to run the jrunsvc command to install a new ColdFusion service in the the services console and to run the wsconfig.jar to connect IIS to JRun (or, if you restore the website from a file, all of that is already there). My runbook went from something like 30 steps down to about 4. Color me happy. And when you think about it, it makes sense. Since it's all built atop Java (minus the other services) there's no reason to go through the installer. You can probably install those other components but I don't really need them, so I don't care to find out how at present. But still, this is a handy little tid bit.

FarCry 5.2 + Railo 3.1.0.16 + Resin + Apache + MySQL + CentOS - Addendum 1

I had an "Ah HA!" moment when I got home tonight. I copied in my FarCry core folder from my known good Ubuntu Railo/FarCry install over to my CentOS install and still had issues. I tried several iterations of this, and then I had a think. I pulled up the Railo admin on my Ubuntu install, and noticed I had it at .012. And then it hit me... I was actually in a discussion about this with others on the google groups. I thought I had tried it at 3.1.0.016, but I think I did not complete the upgrade step.

So, I copied the .012 install of Railo over to the CentOS box and it worked! Huzzah! So, it appears that .012 remains the most supported version at this point in time. I'm hosting a copy of this file on my site, but please be gentle! I don't want to hear it from my host that ya'll are killing my server. You can grab the file here.

FarCry 5.2 + Railo 3.1.0.16 + Resin + Apache + MySQL + CentOS - Part 3

In this installment we're going to be installing FarCry, and tweaking our Apache settings a bit. To let ya'll know upfront, there's still a few issues with FarCry and functions that are named the same as internal Railo functions. I know these changes were placed into trunk at one point, but it doesn't seem like they migrated over to the 5.1.6 release. That's OK, I've got a fairly stable pull of the core trunk files from a few weeks back that I'll be linking on the site this evening. I'll verify that this fixes the odd "function cannot be named" stuff going on. The current trunk files are not allowing the overview page to come up, but then again this is trunk we're talking about... life on the bleeding edge sometimes leads to a paper cut ;).

[More]

FarCry 5.2 + Railo 3.1.0.16 + Resin + Apache + MySQL + CentOS - Part 2

Right... part 2. We're going to install Railo in this section. It's going to be a much smaller ride than part 1 ;). But first, some knowledge.

I've learned that:

  • I'm not a fan of CentOS. I prefer the debian distros. Why? I've not really ever had a need to play with SELinux, or IPTables. Why does that matter? Both of these things have caused me grief whilst putting this together as both are enabled by default in both the _64 and i386 builds of 5.3.
  • You must turn off IPTables on each boot of the system. I'm sure there's a way to make this automatic, but I really haven't tracked it down yet. Yes, it would not be an issue if I just set it up... surely this will be a blog posting down the line, but I don't require it for now.
  • I had originally done the write up for part 1 with an _64 build. Everything was great until I got to the point where I needed to build mod_caucho. I could not find a way to successfully build that, and it appeared to be an issue with apsx. I didn't really want to spend my entire day chasing down rabit holes, so I switched to the i386 build. It's at this point that I learned that SELinux was preventing Apache from talking to Caucho. Again, not wanting to chase my tail endlessly, I just disabled SELinux for now.
  • Use PUTTY! I can never get copy/paste to play nice between my VM command line screen and windows. So, I'll just minimize the VM and use PUTTY to terminal (over SSH) into virtual box. In this way, you can also keep several screens up at one time.

[More]

FarCry 5.2 + Railo 3.1.0.16 + Resin + Apache + MySQL + CentOS - Part 1

Woah... not such a catchy title, but it's descriptive, non?

This all began as a quest to be able to provide a VPS solution to the lowest bidder situation. Their host provides CentOS machines at a fairly reasonable price, but that price would not include the cost of a ColdFusion license. My framework of choice is FarCry, and lately the Daemonites have taken great strides in keeping the framework compatible with Railo. This is the thorny path towards creating a Linux virtual machine with FarCry, MySQL, Railo, and Apache (oh... and SES URLs).

We'll start by just getting the basics of the system running and in place.

  • Everything I'm doing is as the root user... yes, not cool, but this just development. Typically, you should really use sudo to do all of this.
  • Grab a VMware image of CentOS 5.2. You can find one here: http://www.vmware.com/appliances/directory/1309. VMplayer can be found here: http://www.vmware.com/download/player/
  • Turn off IPTABLES for testing... yes, not the best idea for production, but this is development. I could not figure out why the heck Apache wasn't serving pages outside the local install, and it was the firewall blocking it. In production, you should really turn this feature on. I'm not addressing how to do so for this excercise.

    • /etc/init.d/iptables save
      /etc/init.d/iptables stop
  • Enable RPMforge packages. This will allow us to install phpMyAdmin through yum.
    • http://wiki.centos.org/AdditionalResources/Repositories/RPMForge (source)
    • Download either i386 or _64 RPM dependant on your OS type version
      • http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
      • http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
    • Import GPG key
      rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
    • Install it (replace the RPM with the name)
      rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm
  • We need to install apache (well, not NEED, but we're not using Tomcat here)
    • http://www.railo.ch/blog/index.cfm/2008/11/12/Installing-ResinRailo-on-CentOS (source)
    • yum install httpd httpd-devel openssl-devel
  • We need to install MySQL
    • http://www.ozzu.com/unix-linux-forum/centos-and-apache-php-mysql-t69484.html (source)
    • vi /etc/yum.repos.d/CentOS-Base.repo
    • change enable=1 for centosplus
    • yum install mysql-server mysql
  • I installed PHP/PHPmyadmin - just for DB administration
      yum install php php-mysql phpmyadmin
      cd /usr/share/phpmyadmin/
      vi config.inc.php
    • enter a value in $cfg['blowfish_secret'] = '<something>';
    • vi /etc/httpd/conf.d/phpmyadmin.conf
    • change the allow line to (yes, yes... but this is a test environ) to Allow from all
  • We need to install a JVM... this part just sucks. Unlike other distros, no precompiled version really meets our needs.
    • http://j2eeinaction.blogspot.com/2009/02/install-java-6-on-centos-52.html (source)
    • Go to http://java.sun.com/javase/downloads/index.jsp (grab the JDK!). You can browse to a download link and post that into your VM as something like the following
    • wget http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u14-linux-x64-rpm.bin?BundledLineItemUUID=CXFIBe.pePAAAAEioR0Hk1t8&OrderID=CgtIBe.pcWUAAAEilh0Hk1t8&ProductID=tPxIBe.oz2IAAAEhmh0zLjfT&FileName=/jdk-6u14-linux-x64-rpm.bin
    • rename that long ugly file to jdk.rpm.bin
    • mv <stupid long name> jdk.rpm.bin
    • chmod 700 jdk.rpm.bin
      ./jdk.rpm.bin
      /usr/sbin/alternatives --config java
  • Start Apache and MySQL at reboot
      /sbin/chkconfig httpd --level 2345 on
      /sbin/chkconfig mysqld --level 2345 on

And that's it. You have Apache serving pages at http://yoursite/ and phpMyAdmin at http://yoursite/phpmyadmin. Next up on the chopping block, adding Railo into the mix.

Fedex interactions... you are a bleeding pain

There has been some talk on CF-Talk lately about interacting with the Fedex WSDL/services. There's not really much in the way of examples that I could easily find on how to use this WSDL... and I've still not gotten over my hate of working with CFHTTP and authorize.net. I was hopping to not have to deal with that pain again, and it seems I won't!

So, we have this link to a most excellent (and free!) CFC here. You'll still need to step through the hoops to get a developer code from Fedex, but once you do...


<cfinvoke component="fedex" method="getRates" returnvariable="fedex"
shipperAddress1 =     "474 N Centre St"
shipperCity =         "Pottsville"
shipperState =         "PA"
shipperZip =         "17972"
shiptoAddress1 =     "79 TW Alexander Dr"
shiptoCity =        "Durham"
shiptoState =         "NC"
shiptoZip =         "27709"
pkgWeight =            "3"
pkgValue =             "100"
myKey =    "<your value>"
myPassword="<your value>"
myAccountNo="<your value>"
myMeterNo="<your value>"
>


<cfdump var="#fedex#">
    <cfoutput>
    <select name="shipping">
            <cfloop from="1" to="#arraylen(fedex.rate)#" index="n">
                <option value="#fedex.rate[n].cost#">#fedex.rate[n].type# - #DollarFormat(fedex.rate[n].cost)#</option>
            </cfloop>
    </select>
    </cfoutput>
This example (provided by the original author) includes a handy select box. This is great for me, and saves a TON of time playing with the XML.

PS.... I forgot to close the code block... I'm thinking BlogCFC could use a rich text editor.

Google brought down my house of cards

For almost three years now we've been running ColdFusion (well, really JRun) session based replication and failover on all of our hosted ColdFusion environs. Things were great! And then, we let google in the door to index our content. Things went from "great", to "why is this always down??". I spent far too much time looking at JVM settings, JRun settings, etc., but never really came up with a concrete answer as to what was happening. Ultimately, we'd see a deluge of errors about the failure of session replication in the log files and a complete breaking of failover and sometimes even the JRun -> IIS connector.

Whilst searching for the session replication errors, I came across Sean Corfields postings across various blogs that replication just does not scale well, and that it remains a broken feature. Up until a few months ago, I'd argue this to be untrue. However, it appears that replication works... if you can manage to keep the amount of crap you throw into shared memory scopes down to a minimum.

It's been 4 days since I've disabled session replication, and my servers have remained standing for an equal amount of time. We've been getting indexed by google (and others), and things are sailing along with nary a blip. Next stop, creating a guide for users that want/need session based failover that can be accomplished in code. Otherwise known as, "Help me Sean Corfield, you're my only hope!" ;).

Add bulk file uploads to FarCry 5.x

If you look in the content administration section of the FarCry admin, you'll find a handy little flex tool for uploading multiple images. Sadly, there is no matching tool for uploading bulk documents.

Have no fear, as the source will set you free! The flex UI component that pulls off the Image uploads is also available from the Daemonites at http://svn1.cvsdude.com/modius/farcry/flexUI/multipleImageUploader/trunk/. It is, however, a tad out of date. And unless you know flex... it's a bit of a pain as well to get it up and running. However, I've included a handy little zip that contains a complete working flex project if you should so choose.

So, I changed the flex UI piece to be named "Multiple Files Upload" and also changed the default CFM files being called (you can pass values in) to the correct file upload pieces. The files you'll need are:


farcry\core\webtop\admin\bulkfileUpload.cfm
farcry\core\webtop\admin\multipleFilesUploader.cfm
farcry\core\webtop\admin\ui\swf\multipleUploaderFile.swf

You'll also need to add a link to the webtop in your customadmin\customadmin.xml like (this goes into the current "content" section):


<subsection id="contentpublishing" sequence="10" label="Content Publishing">
            <menu id="MediaLibraryContent" sequence="20" label="Media Assets">
                <menuitem id="bulkfileupload" sequence="31" label="Bulk File Upload" link="/admin/multipleFilesUploader.cfm" />
            </menu>
        </subsection>

Reload your application, and that's it. You should now have the ability to upload multiple flies (.pdf, .doc, .zip only... you can modify the flex/swf to accept other attachments as well).

UPDATE: I added a new URL param, fileList and extension. You can now control the file list through the multipleFilesUploader.cfm. Updated the zip to reflect this.

Files

PNG not showing using Built-in JRun webserver

My friend Michael blogged about an issue he was having with viewing PNG files when using the built-in JRun webserver. Just in case this should ever happen to you, here's the link.

It appears I didn't get the link right. It's fixed now.

Same look, newer engine

I upgraded to BlogCFC 5.9.2.002 today. I'm trying to eliminate some of the spam I've been seeing (without resulting to approving all comments). We'll see how it works.

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.002. Contact Blog Owner