Cf.Objective()

ColdFusion 8 on Leopard with Apache - an answer for the rest of us

Comments (32) || ColdFusion 7825 Views

Mark Drew had a recent post describing his success in running ColdFusion 8 on Leopard. Unfortunately for me (and apparently several others) no matter how many deletes and reloads it didn't work for me. Just for the sake of completeness, I deleted the directories, emptied the trash, then rebooted between installations. Same exact problem with each installation.

I could get both the standalone and multiserver editions running from the terminal prompt using either of the following commands.

Standalone ColdFusion:
sudo /Applications/Coldfusion8/bin/coldfusion start &

Or for the Jrun Server Edition:
sudo /Applications/JRun4/bin/jrun -start cfusion &

In both of these cases, it started up and I was able to open the ColdFusion Administration page.

My problem was that I really wanted to get it working with Apache but I was having issues with the connector. The error became clearer when issuing the command: sudo /usr/sbin/httpd which returned this message:

Cannot load /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so into server: dlopen(/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so, 10): no suitable image found. Did find:\n\t/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so: mach-o, but wrong architecture

A post by Ulf Unger on CF-Mac about Compiling Apache 2 2 Module on Leopard for ColdFusion MX 7 highlighted the answer.

go to terminal window.
cd /Applications/JRun4/lib
unzip -d src wsconfig.jar
cd src/connectors/src

apxs -c -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -n jrun22 \
mod_jrun22.c jrun_maptable_impl.c jrun_property.c jrun_session.c \
platform.c jrun_mutex.c jrun_proxy.c jrun_utils.c

apxs -i -n jrun22 -S LIBEXECDIR=/Applications/JRun4/lib/src/connectors/src/ \
mod_jrun22.la

strip mod_jrun22.so

Now run the connector configuration:
sudo java -jar /Applications/JRun4/lib/wsconfig.jar

After it finishes, run this command:
cp /Applications/JRun4/lib/src/connectors/src/mod_jrun22.so /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so

sudo apachectl restart

Knowing that some folks may have trouble with installing the Apple Developer tools on the Leopard DVD just to make a 90k file, I've attached the updated mod_jrun22.so to this post. Run the wsconfig command then ignore the errors. After it has finished, Click the download link below and then replace your mod_jun22.so with the file in the zip.

I've tried this on a newer mpb, a first gen mbp, and a macbook with success. Let me hear from you if you have any issues with this.

Link:
Compiled mod_jrun22.so

UPDATE: Oct 30, 2007

You can mix/match to just compile for your mac

/usr/sbin/apxs -c \ -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400 \ -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64 \ -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 \ -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 \ -n jrun22 /Applications/Coldfusion8/runtime/lib/bak/connectors/src/mod_jrun22.c \ /Applications/Coldfusion8/runtime/lib/bak/connectors/src/jrun_mutex.c \ /Applications/Coldfusion8/runtime/lib/bak/connectors/src/jrun_property.c \ /Applications/Coldfusion8/runtime/lib/bak/connectors/src/jrun_proxy.c \ /Applications/Coldfusion8/runtime/lib/bak/connectors/src/jrun_session.c \ /Applications/Coldfusion8/runtime/lib/bak/connectors/src/jrun_utils.c \ /Applications/Coldfusion8/runtime/lib/bak/connectors/src/platform.c


Related Blog Entries


Comments

  1. Hi Scott,

    I tried compiling it and the download and still get:
    httpd: Syntax error on line 493 of /private/etc/apache2/httpd.conf: Cannot load /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so into server: dlopen(/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so, 10): no suitable image found. Did find:\n\t/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so: mach-o, but wrong architecture

    Weird. Gonna try restarting.

  2. I'm getting the same error as Luis above. I followed the directions exactly except that I installed the XCode Developer Tools instead of downloading your compiled mod_jrun2.so

  3. These are the four different architecture types, just swap out the lines to match your system:

    -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400
    -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64
    -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64
    -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386

    I also updated the post above and added a link to a universal compiled binary. Might help someone out.

  4. Thanks for the info, but I'm getting hung up on the first apxs command. It seems to start OK, but here's the output:
    --------------
    apxs -i -n jrun22 -S LIBEXECDIR=/Applications/JRun4/lib/src/connectors/src/ mod_jrun22.la
    /usr/share/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1/build-1/libtool' mod_jrun22.la /Applications/JRun4/lib/src/connectors/src/
    /usr/share/apr-1/build-1/libtool --mode=install cp mod_jrun22.la /Applications/JRun4/lib/src/connectors/src//
    libtool: install: `mod_jrun22.la' is not a valid libtool archive
    Try `libtool --help --mode=install' for more information.
    apxs:Error: Command failed with rc=65536
    --------------
    I'm on an Intel Mac Mini. Any help is appreciated!

  5. @Joshua Do you have the XCode tools installed?

  6. Joshua - that command should be the second command.

    apxs -c -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -n jrun22 mod_jrun22.c jrun_maptable_impl.c jrun_property.c jrun_session.c platform.c jrun_mutex.c jrun_proxy.c jrun_utils.c

    is the first command followed by the one you listed. You can also save a few steps and download a compiled version listed above in the post.

  7. Luis/Aaron - try running this command:

    file /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so

    It should give you back something like this:
    /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so: Mach-O 64-bit bundle x86_64

    If not, it is the wrong version. Post back the results of that command if you are still having issues.

  8. Hey Scott..

    I've tried the above post w/ numerous x no luck, running apxs using (86_64) which matches my machine, still getting

    "Cannot load /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so into server: dlopen(/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so, 10): no suitable image found. Did find:\n\t/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so: mach-o, but wrong architecture"

    Any thoughts on why this err persist?

  9. @pgreen:
    run this in termina:

    file /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so

    It should give you back something like this:
    /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so: Mach-O 64-bit bundle x86_64

    If it doesn't, then the file is still the old one. You can download the correct file from the post. Let me know if you still have problems.

  10. Yeah! This finally solve my problem, thank you man :D

    ... mhh, I'm wondering if is it possible (or better HOW), automatically start coldfusion, without to have to type -start cfusion in the terminal :/

  11. I've been working this all day, and no matter what I do I can not get apache to load either the file I made with the XCode tools or the one that is on the post. I did the step in post 9 above, and I get that result, but I still get the "wrong architecture" error. I am running a 1.83 intel duo Macbook. When I try open the CF administrator, the browser tries to download the index.cfm file. I've modified the Apache httpd.config file's DirectoryIndex to include index.cfm, and verified the JRun settings that were appended.

    By the way - what is the significance of the ampersand at the end of the coldfusion startup string? (I'm sort of noobie on Unix stuff)

  12. The ampersand tells the command to run in the background. Simple terms - If you leave that off, the command issues stays in the foreground and doesn't give you back the prompt. Closing the terminal window would also close the active command.

    Back to the CF issue, make sure the JRun settings in the apache config file are pointed at the correct mod_jrun22.so file. I'd guess that the config is pointing at a different file than the one you modded.

    Also, verify the filetype by running file /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so (or whatever the path is). It should say:

    It should give you back something like this:
    /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so: Mach-O 64-bit bundle x86_64

  13. Hey Scott,

    Typed "file /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so" as you recommended and rcvd "/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so: Mach-O 64-bit bundle x86_64"

    Still getting same error from apache. any idea?

    THanks

  14. Scoot,

    After running through the process again, I notice that I'm getting the following err. when running the "strip mod_jrun22.so" cmd

    " symbols referenced by indirect symbol table entries that can't be stripped in: /Applications/JRun4/lib/src/connectors/src/mod_jrun22.so"

    Any thoughts? Thanks

  15. nah - that shouldn't stop it from running.

    Just for grins, do a uname -p and see what it returns

  16. Hey Scott,

    uname -p came back i386. Followed your instructions w/ this var and works!

    Thanks alot for you help...

  17. I followed the discussion up to this point and landed on the same error as PGreen: "sh: strip: command not found". I'm guessing that getting past this problem has something to do with the results from "uname -p" which, in my case, is "powerpc". How do I apply that information?

  18. @Kent - try changing the compile command to this:

    apxs -c -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64
    -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400 -n jrun22 mod_jrun22.c jrun_maptable_impl.c jrun_property.c jrun_session.c platform.c jrun_mutex.c jrun_proxy.c jrun_utils.c

    Followed by:
    apxs -i -n jrun22 -S LIBEXECDIR=/Applications/JRun4/lib/src/connectors/src/ \
    mod_jrun22.la

  19. Thanks.

    When I tried that, I got this:

    /usr/share/apr-1/build-1/libtool --silent --mode=compile gcc -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/usr/include/apache2 -I/usr/include/apr-1 -I/usr/include/apr-1 -arch ppc64 -arch ppc7400 -c -o mod_jrun22.lo mod_jrun22.c && touch mod_jrun22.slo
    /usr/share/apr-1/build-1/libtool: line 1219: gcc: command not found
    apxs:Error: Command failed with rc=65536

    I also tried going back to the original compile command and got a similar (identical?) result.

    Let me retrace my steps a bit to see if previous attempts may be botching the current endeavor.

    [1] I tried to get ColdFusion to work with Apache by installing XAMPP first, which worked (I could see the main page and all of the their apps).
    [2] I used the terminal to stop XAMPP and modified the XAMPP apache config file include index.cfm (/applications/xampp/xamppfiles/etc/httpd.conf).
    [3] I installed ColdFusion (JRUN) and, during the install, I set the Apache directories as follows:

    Configuration Directory:
    /Applications/xampp/etc

    Directory and file name of server binary:
    /Applications/xampp/xamppfiles/bin/httpd

    Directory and file name of server control script:
    /Applications/xampp/xamppfiles/bin/apachectl

    I also put the CFIDE files in the default directory for XAMPP, which is /Applications/xampp/xamppfiles/htdocs

    [4] I restarted XAMPP (and it worked). While ColdFusion started in the terminal every browser wanted to treat the administrator's index.cfm page as a download. During subsequent attempts I tried installing CF8 as a standalone.

    Before I tried your solution, I tried to uninstall JRUN but the uninstall program said the admin password didn't match the system (though it did). That lead me to uninstalling it by dragging it into the trash.

    Which leads me to the current attempt. I re-installed the JRUN version of CF8 and used all of the default directories. My assumption here is that the fresh install will try to work with the Apache server that comes with Leopard. However, given it's still misbehaving, I'm beginning to wonder if something from XAMPP is getting in the way. Any ideas?

    By the way, none of my installs of CF8 have resulted in me being able to see the administrator's index.cfm.

    Again, I'm just trying to offer a map of where I've been. Thanks for wading through this.

  20. Scott,

    K, just installed leopard and CF8, I've gotten CF8 running via command line -> jrun -start cfusion. Although I can't start my jrun via the CF Launcher. Whats up with that?
    Back to my issue (or lack of) I'd also like to start up my CF8 server via apache, but I did the command you stated (httpd) and it didn't return any error...? Im not sure what I shall do at this point. I don't believe I should start replacing apache modules until I see an error... wouldn't you concur? All I know is when I reboot I have to drop into my terminal to start-up CF. Is there anyway I could avoid this...? Perhaps get my CF Launcher to work? or something...


    Any thoughts?

  21. Also is this compiled apache module only for mactels? 64 bits? or would this work on any platform? I'm running a PB G4 PPC...

    thanks much

  22. Is this post closed? Or just ignored...?

  23. Sure appears that way - sorry about that. My best suggestion is to go to Adobe and sign up for the beta release of ColdFusion on leopard.

    Link:
    http://www.adobe.com/cfusion/mmform/index.cfm?name...

  24. cool. thanks!

  25. Scott,

    Thanks for the great tips on getting this two work. I tried for 3 or 4 days to get ColdFusion to work on my PowerMac g5 and I just could not get it going.

    I ended up doing a video tutorial on installing CF8 on Leopard using MAMP to run Apache. If any of you would like to check it out please feel free to check out the post on my blog. It was a really frustrating process to get CF8 up and running and I hope this solution saves some of you a log of trouble. http://www.flashalisious.com/2007/12/14/installing...

  26. Hmm... I'm having problems with the last step of cp /Applications/JRun4/lib/src/connectors/src/mod_jrun22.so /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so

    It's saying No such file or directory.

    I tried to manually go and create the "1" folder, but it's saying Permission denied. Any ideas?

  27. Alright, I solved the problem that I had mentioned in the comments right above this. (I am doing this CF Install mainly following the instructions here:
    http://blog.daemon.com.au/go/blog-post/how-to-inst... )

    To fix the problem of not being able to put the mod_jrun22.so file in the wsconfig folder, I had to change the settings in finder to allow me to read and write (before, it was set to read only). Once that was done, I manually copied the .so file.

    Changing the httpd.conf file in /etc/apache2/folder was also a little tricky. I had to first get to it using the "Go to Folder" command in finder and then in order to make changes, I had to copy it to my desktop, make the changes:

    DirectoryIndex index.html and change it to DirectoryIndex index.cfm index.html

    and then repaste it back in the original apache2 folder, overwriting the file already there.

    Now however, when I open up my Safari browser to:
    http://localhost/CFIDE/ , any link that I click on (for example: the Application.cfm file or the adminstrator folder) saves as a .class file.

    Any ideas on what's wrong?

  28. I too have been having problems getting mod_jrun22.so to work, I got 'wrong architecture' message so I followed the above instructions and built a new one successfully, however it now tells me:
    Symbol not found: _gtod\n Referenced from: /Applications/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun22.so\n Expected in: dynamic lookup\n
    The box is a PowerPC G5
    running file on the .so gives
    file mod_jrun22.so
    mod_jrun22.so: Mach-O universal binary with 4 architectures
    mod_jrun22.so (for architecture ppc7400):   Mach-O bundle ppc
    mod_jrun22.so (for architecture ppc64):   Mach-O 64-bit bundle ppc64
    mod_jrun22.so (for architecture x86_64):   Mach-O 64-bit bundle x86_64
    mod_jrun22.so (for architecture i386):   Mach-O bundle i386

    looking at 'about' tells me this is a PowerPC 950 (2.2)

    I haven't tried the MAMP option yet, that's next I guess

  29. nice site
    You may have a good reason to use Apache if you are mixing other server side technologies
    just what i needed. thanks
    Andrzej Filipowicz
    http://www.andrzejfilipowicz.com
    Still life Artist
    http://life.e-phils.com/
    still life painting

  30. Wondering if you could compile some different mod_jrun22.so files because I'm just can't get it to work on my macbook pro thank you

  31. I followed the instructions at http://localhost:8500/cfdocs/htmldocs/help.html?co... and then added your mod_jrun22.so and it all works fine.
    Thanks!

  32. i think i ll start blaming my self i give up on Windows. I had everything done there in 2 minutes. In that f%$*%^%ng Leopard i have waisted a full day , and nothing yet !!!!
    The Admin Service is comming up , theTest service is comming up, The apachee is comming up BUT tht cfusion service wont run with anything.

    Aynyone with another help way , i have tried this ones from here a dozen times.

© 2007 Scott Pinkston, LLC || Design by N.Design Studio || Powered by BlogCFC || Entries RSS || Login