Linux, Apache 2.2.3, and CFMX 7.2

Update: 06/03/2007

With the help of Simeon Bateman, this week I was able to get ColdFusion MX 7.2 to hook-up with Apache 2.2.3 under PCLinuxOS. Really it's not that difficult (if you find the right resources).

Below are some instructions for anyone else trying to coerce ColdFusion 7.0.2 to play nice with Apache 2.2.3. And for my personal reference of course.

So, first things first. Do you have Apache 2.2.3? If you have recently downloaded a current Linux distro, you probably do. But, to check, you can run the command "httpd -v" in a console. (See my results below.)

[cphillips@localhost ~]$ httpd -v
Server version: Apache/2.2.3
Server built: Oct 31 2006 12:43:51

Ok, if you have Apache v2.2.3, then let's keep going.

Folow the instructions on this page up through step 12. But, do not have it configure Apache during the install. We're going to do that later.

Note: Step 5 says to login as the "root" user. So, when you open the console, use the "su" command and enter the root password. (See example below.)

[cphillips@localhost ~]$ su
Password:
[root@localhost cphillips]#

You may get an error saying something like "error while loading shared libraries: libc.so.XX". I did. And I was able to fix it by following the instructions on this page on Steven Erat's blog.

Read Steven's blog post if you want to understand the issue. (See below for what worked for me. Note that the file name has changed since his post.)

[root@localhost cphillips]# mv coldfusion-702-lin.bin coldfusion-lin.bin.bak
[root@localhost cphillips]# cat coldfusion-lin.bin.bak | sed "s/export LD_ASSUME/#xport LD_ASSUME/" > coldfusion-lin.bin
[root@localhost cphillips]# chmod +x coldfusion-lin.bin
[root@localhost cphillips]# ./coldfusion-lin.bin
[root@localhost cphillips]# /opt/jrun4/bin/jrun -start cfusion

At this point you should be able to login to the ColdFusion Adminsitrator using the built-in http server at port 8300. Go ahead login and let it go through it's first time setup stuff. Then come back and we'll set up the connector.

Ok, assuming that went well, now you just have to configure the connector. In order to do that you'll need the hotfix from Adobe. Get the wsconfig.zip from this page. Replace the one in "/opt/jrun4/lib/" with the new one from the zip file.

Now that you have the updated wsconfig.jar, stop Apache and the cfusion server. Then, run the below set of commands.

[root@localhost /]# cd /opt/jrun4/lib
[root@localhost lib]# java -jar wsconfig.jar -ws apache -dir /etc/httpd/conf -server cfusion -bin /usr/sbin/httpd -script /usr/sbin/apachectl -coldfusion

When I ran the above code the first time, I got an error saying something like "Could not find the required apxs (Apache Extension Tool) binary /usr/sbin/apxs". Simeon told me that I needed the Apache development tools. So, I just used the package manager in PCLinuxOS and had it get the "apache-devel" package. Then, I ran it again, and it worked!

UPDATE: You may also get the error, "Exception occured trying to get an MBean". This is most likely because you are using JVM 1.5+. You will have to run the connector with the JVM 1.4 as explained here.

Now, start apache and cfusion. You should be able to run a test cfm from your apache web root. If it doesn't work, don't give up. Google is your friend. And there are lots of people out there willing to help.

I hope having this compiled here helps someone. I know it will help me if I have to do this again.


Update: 06/03/2007

Ha ha! It did help me. And I made some changes after really using it from scratch.

Comments
Michael Brennan-White's Gravatar Great tutorial, but I screwed up.

I am used to selecting the internal server rather than multiple servers and I think that is where I messed up because I don't have the jrun options.

Is there a way to install jrun after the coldfusion install is completed and then configure Apache to process the cold fusion pages?
# Posted By Michael Brennan-White | 5/1/07 10:01 PM
Chris Phillips's Gravatar Michael,

I think that JRun get's installed with the standalone too. It's just under the hood.

So, I'll give you two answers:

One: You might be able to connect Apache to the standalone CF install. Try running "whereis wsconfig.jar" in the console. If you find one, then try using my instructions against that one.

Two: It is not that hard to re-install CF as the multi-server version. So, that is probably what I would do personally.
# Posted By Chris Phillips | 5/2/07 8:41 AM
J-P Stacey's Gravatar Thanks for the clarifications. The official Adobe instructions are a bit rubbish, especially where they ask you to shut down CF before running wsconfig.jar .

For reference, I got a further error saying "This web server is already configured for JRun." If you get this error, you need to remove the site before reconfiguring it: running the .jar without any arguments brought up a graphical interface where I could select the site config and remove it.
# Posted By J-P Stacey | 8/2/07 2:25 AM
J-P Stacey's Gravatar Also (apologies for commenting twice) depending on your system you'll need to change your configuration for which module to load: Apache was still trying to load mod_jrun20.so, whereas that no longer exists: it gets moved to mod_jrun22.so .
# Posted By J-P Stacey | 8/2/07 2:35 AM
Teeps's Gravatar If you are having issues with an IOException not having proper permissions to edit the jrun.xml file... it is not enough to be su'd to root. You have to log out and log in as root. That was the only thing that worked for me. I was trying this with CF8 and it worked.
# Posted By Teeps | 10/18/07 8:33 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.6.002.