Apache-CF configuration question

19 views
Skip to first unread message

Rich

unread,
Oct 27, 2008, 12:13:40 AM10/27/08
to model-glue
hi Gang~

I just got a new Mac and need to install CF and MG on it. Mac OSX
10.5.5, will install CF 8.01, and would like to take advantage of my
new 64 bit monster ;-)

I also have multiple sites that I've built in MG and am curious what
the best way is to install CF and MG using the Apache web server. I'm
completely new to Apache; have always either used CF's built in
webserver or IIS (or clients have already had the servers configured
by the time I arrived on site). On top of all that, I just got CS4
and would like to setup my sites using Dreamweaver (I know many of you
don't care for it, neither did I and still have Eclipse, but I saw a
guy do a demo building some forms using the Design view of DW and he
knocked out a full CRUD front end in about 2 minutes simply dragging
dropping, very impressive).

Anyone have any suggestions on how best to handle the CF Mac install
to handle multiple MG sites?

Thanks in advance, you folks are an awesome bunch.

Rich

Adam Tuttle

unread,
Nov 3, 2008, 10:11:01 AM11/3/08
to model...@googlegroups.com
Rich, the install process should be almost exactly the same as on
Windows. The CF installer will have options to set itself up under
Apache (if it's running) as opposed to IIS. Then you'll go into your
CF Administrator and create a mapping for /modelglue and MG is
"installed."

Rich

unread,
Nov 3, 2008, 3:27:24 PM11/3/08
to model...@googlegroups.com
Thanks Adam, I figured it was about as straightforward as that.

So, as a follow up question, do you follow any sort of best practice
to develop multiple sites on the same computer? I have multiple
clients and would like to emulate their production environment, at
least as far as file structure is concerned, whenever possible. So if
i want to develop multiple sites from my webroot is there an easy(ier)
way to do this using Apache and CF on Mac OSX? Sometimes in the past I
simply move entire directories in and out of webroot, which just seems
like the slow way to done....

Thanks again for your help,

Rich

Rich

Rich Leach
Advanced Certified Adobe ColdFusion Developer
ri...@cfsnap.com
http://www.cfsnap.com
303-913-7338
Instant Messenger:
AOL AIM: cfsnaprich
Instant Video Conference:
APPLE MobileMe: rich...@me.com


Chris Blackwell

unread,
Nov 3, 2008, 3:54:08 PM11/3/08
to model...@googlegroups.com
I use a linux dev box, but the principal should be the same.

setup apache to use virtualhosts, that way you can have multiple webroots.
http://httpd.apache.org/docs/2.0/vhosts/

<VirtualHost 192.168.100.110:80>
ServerName mysite.dev
DocumentRoot /home/mysite.dev/public_html
ErrorLog /home/mysite.dev/logs/error_log
CustomLog /home/mysite.dev/logs/access_log combined
</VirtualHost>

i use a .dev suffix for my dev sites, which is resolved for me by the DNS on my dev box, but you can still use the same by manually entering the hostname & ip in your hosts file

Chris

2008/11/3 Rich <ri...@cfsnap.com>

Adam Tuttle

unread,
Nov 3, 2008, 4:22:06 PM11/3/08
to model...@googlegroups.com
I completely agree with Chris and operate much the same way myself;
though I use the hosts file instead of running DNS locally.

Chris Blackwell

unread,
Nov 3, 2008, 5:06:59 PM11/3/08
to model...@googlegroups.com
going slightly off-topic..

setting up dev sites is a real pet-hate of mine, so i spent a while setting up my environment to be as automated as possible
i use virtualmin (http://www.virtualmin.com/) to manage my dev box (and virtualmin pro on my hosting servers) so when i need a new server i just enter the domain name and it sets up apache, local dns, svn repo and a mysql db for me, it also creates a cname entry on my real dns servers so that my clients can view the dev site from outside the office. 

beats manually editing host files, create db's and setting permissions manually :)


2008/11/3 Adam Tuttle <j.adam...@gmail.com>

Rich

unread,
Nov 3, 2008, 5:20:12 PM11/3/08
to model...@googlegroups.com
Wow, that is an amazing tool! I'm just a little hesitant given that it looks like any Mac installs will have to be done manually; none of their scripts seem to support the Mac. But if nothing else, this is just a great tool to know exists and bookmark it because at some point I'll be able to put it to use!

Thanks,

Rich

Chris Blackwell

unread,
Nov 3, 2008, 5:33:38 PM11/3/08
to model...@googlegroups.com
CentOS + Virtualmin is great way to recycle an old PC into a dev box ;)

2008/11/3 Rich <ri...@cfsnap.com>

Jared Rypka-Hauer

unread,
Nov 4, 2008, 1:05:14 PM11/4/08
to model...@googlegroups.com
At one point I had a tool for OSX that allowed you to manage your Apache config files, but I can't remember what it was called... and I didn't like it. It reformatted my config file and made things ugly. I tend to be pretty nitpicky about the formatting in my config files (because at some point they have to be human-readable), and it just didn't honor my standards! How rude, eh? ;) I've never actually found a GUI front-end for the Apache config that I really liked, actually... it's a wonder there's not an Eclipse plugin for it that gives you context-based directive insight and stuff. Maybe there is, I'll have to check it out.

I don't mind managing my Apache config by hand on a local dev box and I don't ever have to deal with the servers, so it's no big deal for me to copy/pasted a vhost block, change the paths and log file names and add a line to the hosts file.

I don't run DNS locally either.

Typically, I have my codebase checked out from SVN, and the Apache vhost's webroot pointed at the portion of the working copy that is the webroot (at Alagad we usually use a subfolder of the repo for the wwwroot), so I can dev, test and checkin pretty seamlessly. My workflow goes something like this:

1) Checkout code
2) Edit Apache config
3) Edit /private/etc/hosts
4) Bounce Apache

Takes a total of about 10 minutes, depending on the repository size and any special configs.

On 10.4 I kept all my projects in my Documents folder and pointed Apache's vhost there... however on 10.5 that doesn't work because they have security in place to block access to these files from the web server, so everything has to be checked out into /Users/{username}/Sites and that can be used as the webroot of the vhost.

I use TextWrangler to edit my config files because it's the only one out there that makes opening/editing secured files easy... use File > Open Hidden... to get to /etc/hosts and /etc/apache2/http.conf... super simple. You may have to change the dropdown at the top of the Open File dialog to All Files instead of All Editable Files to make it work.

Something of note: I always install CF using the built-in webserver. After installing CF I use {cf_home}/lib/wsconfig.jar to add the connector to Apache. Note that the built-in webserver can be shut off using either the JRun Admin server or via editing {cf_home}/runtime/servers/coldfusion/SERVER-INF/jrun.xml on Standalone or {jrun_home}/servers/{servername}/SERVER-INF/jrun.xml, finding the block that starts with <service class="jrun.servlet.http.WebService" name="WebService"> and changing the attribute "deactivated" to "true", then restarting the CF server. I leave CFIDE and WEB-INF in the default location and create a symbolic link to it in the webroot of any vhost that needs access to it. You need access to it for the scripts and CSS for any AJAX stuff, so it may be important to do this. I like having CFIDE in a consistent, central location and adding links to it where needed, and I like having a fully-default CF install so that things are always the same.

HTH,
J

Rich

unread,
Nov 5, 2008, 11:14:41 AM11/5/08
to model...@googlegroups.com
... so as I have the election results on in the background I decided to install CF801 onto my Mac, using Apache and 64 bit. 

The installer stopped me at the 2nd screen, saying "Error: Make sure 64 bit JDK is the default JVM, this version of install requires default JVM to be 64 bit JDK...."  So I opened Utilities, Java, Java Preferences and made sure 64 bit was first in line in both Applets and Applications. I even restarted. The ColdFusion 801 64 bit installer refused to recognize my 64 bit Java setting.  After some Googling it turns out that it may be a Sun Java issue as people who were running older JVMs had success on their CF801 64 bit installs, but evidently the Java update that Apple pushed out in it's Software Update renders the ColdFusion801 64 bit version uninstallable. 

I called and filed a case with Adobe, they said an engineer should get back to me in 24 hours.... we'll see about that. Adobe hasn't been all that reliable in support issues since I've had to deal with them (which is a shame, since I've evangelized a lot of their products to my clients and have tens of thousands of dollars in sales to prove it).

Has anyone else encountered this installation error?

Rich

Brian G

unread,
Nov 5, 2008, 12:30:31 PM11/5/08
to model-glue


On Nov 4, 10:05 am, Jared Rypka-Hauer <armchairde...@gmail.com> wrote:
> "true", then restarting the CF server. I leave CFIDE and WEB-INF in
> the default location and create a symbolic link to it in the webroot
> of any vhost that needs access to it. You need access to it for the
> scripts and CSS for any AJAX stuff, so it may be important to do
> this. I like having CFIDE in a consistent, central location and

There is an easier way to do this than symbolic links; the Apache
alias directive:

Alias /CFIDE /opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/CFIDE

You can do this server-wide or on a per vhost basis. I also posted
some ways I further secure my /CFIDE/Administrator directory this
morning after reading your post: http://www.ghidinelli.com/2008/11/05/access-cfide-with-apache


Brian

Paul Marcotte

unread,
Nov 5, 2008, 12:40:51 PM11/5/08
to model...@googlegroups.com
Rich,

I recently ran into this problem.  CF801 64-bit will install only to Java version 1.5.0_13.  Since I was setting up a new mac, I re-installed and ignored the Java Update for OS X.

http://www.fancybread.com/blog/index.cfm/2008/10/28/Java-For-Mac-OS-X-105-Update-2--ColdFusion-8-Gotcha

I think it really just a matter of updating the installer for OS X to recognize 1.5.0_16 as a valid java version.

Paul
--
Paul Marcotte
Fancy Bread - in the heart or in the head?
http://www.fancybread.com

Rich

unread,
Nov 5, 2008, 1:07:07 PM11/5/08
to model...@googlegroups.com
Wow, at this point for me to reinstall everything is going to be a major p-i-t-a, I can't believe there isn't an easier way to simply get the Mac OS to look at a different version of Java.... maybe I need to search some of the Java or Mac OS X forums.... plus I'd hope Adobe recognizes this problem and has some kind of patch for their installer....

Does anyone know of a way to downgrade the JVM WITHOUT reinstalling the OS? Is that even possible?

Thanks,

Rich

Jared Rypka-Hauer

unread,
Nov 5, 2008, 1:31:09 PM11/5/08
to model...@googlegroups.com
Yeah, it is... gimme a sec to find it and I'll send in another email...

J

Jared Rypka-Hauer

unread,
Nov 5, 2008, 1:45:04 PM11/5/08
to model...@googlegroups.com
Wow, OK, that didn't take as long as I'd expected... although the
answer isn't quite what I thought I was going to say.

Here's your ticket:
http://stackoverflow.com/questions/151414/explain-the-jvm-directory-
layout-on-mac-osx-leopard

Using TextWranger, open ~/.profile and add:

export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/
Versions/1.5.0/Home/"
export PATH=$JAVA_HOME/bin/:$PATH

It may also work to use /Applications/Utilities/Java/{perhaps another
folder here like J2SE 5}/Java Preferences and changing the VM order
to have Java 5 at the top of the list.

OTOH, if you don't have Java 5 on that machine at all, you're kinda
screwed. But on my OSX 10.4.11 install I have JVMs going all the way
back to Java 1.3.0, so you should have some sort of previous versions
there.

For more info, see here:
http://number9.hellooperator.net/articles/2008/05/21/changing-the-
default-jvm-on-osx-leopard

Seriously, this info is sort of old, but I suspect that it should all
work pretty close to the same on 10.5.

Laterz,
J


On Nov 5, 2008, at 12:07 PM, Rich wrote:

Rich

unread,
Nov 5, 2008, 1:57:43 PM11/5/08
to model...@googlegroups.com
Jared-
Thanks so much for the info!
Just as I received your email the support team from Adobe also emailed
me asking for details about this issue, which I just sent off to them.
I'll give them 24 hours to see if they come back with anything
significant and if they don't I'll be diving headfirst into your Java
instructions. I'm all about workarounds, but if I'm going to
recommend, and then have to support a product to a client I feel like
this is something Adobe should be at least be able to recognize and
address. And I'm not the only person having this very issue either.

Thanks again J, beers on me next time I'm in the Alagad 'hood.

Rich

Rich

Jared Rypka-Hauer

unread,
Nov 5, 2008, 6:37:17 PM11/5/08
to model...@googlegroups.com
Ever make it to MN? I'm in Minneapolis. We have a "distributed
enterprise". ;)

I'm in MN, Scott's in WV, Doug is in VA, etc., we're all over the
place. The time zones make things fun.

J

Doug Hughes

unread,
Nov 5, 2008, 6:43:11 PM11/5/08
to model...@googlegroups.com
Im in NC, you insensitive clod!

Doug

On Nov 5, 2008, at 6:37 PM, Jared Rypka-Hauer

Jared Rypka-Hauer

unread,
Nov 5, 2008, 6:54:01 PM11/5/08
to model...@googlegroups.com
I prefer "clump", thank you. And I knew that... but you *used* to be
in VA, right?

:P

J

Doug Hughes

unread,
Nov 5, 2008, 8:33:22 PM11/5/08
to model...@googlegroups.com
Going by that logic, I live in Michigan and Florida too!

Doug Hughes, President
Alagad Inc.
dhu...@alagad.com
888 Alagad4 (x300)
Office: 919-550-0755
Fax: 888-248-7836

Jared Rypka-Hauer

unread,
Nov 5, 2008, 10:26:02 PM11/5/08
to model...@googlegroups.com
Well, you're just all over the place then, aren't you?

Seriously, though, you are, in fact, in NC and any suggestion to the contrary was inadvertent.

I, however, have only ever lived in MN, so no matter where you say I'm from, as long as I've lived there in the past, well, I still live there. ;)

J

Vicky

unread,
Nov 6, 2008, 8:24:48 AM11/6/08
to model...@googlegroups.com
What exactly is the contest?  I live right on the spot where three towns meet.  My nearest post office, .5 miles away, is not in my town and no one is sure where I live.  Plus there are two streets with the same name in my community, so half the time someone else gets our food deliveries.  Not to mention, we live on the corner of two streets...  our land was originally meant for 2 houses til they found out the marsh on the second lot wouldn't allow for a house... so I have my main mailing address, and then the electric company, no matter how many times I correct them, bills me for the other street where there is no mailbox.
 
I want to move the mailbox and change our address from the one street to the other so I can get my food delivery, but I am not allowed.
 
Do I win?

Jared Rypka-Hauer

unread,
Nov 6, 2008, 8:48:46 AM11/6/08
to model...@googlegroups.com
No, the only contest is twixt Doug and I trying to be clever.

We're both struggling. But he DID call me an "insensitive clod" as if
he were some sort of alien and I'd just shot his head off. Next
volley moves south a couple feet. ;)

J

Rich

unread,
Nov 7, 2008, 9:10:13 AM11/7/08
to model...@googlegroups.com
J~

I opened a case with Adobe about this issue and received word today
from their engineering team that they can reproduce the issue, so it
sounds like they'll work on some sort of a fix or patch.

FWIW here is what looks to be the error code from the coldfusion_err
log:

***start***
System's temporary directory = /private/var/folders/
32/3274+vX0GLijmxZCpaVp0k+++TI/Cleanup At Startup/
Installer: no 'sea_loc' in working dir, couldn't define
$EXTRACTOR_EXECUTABLE$

Loading externalized properties

SHUTDOWN REQUESTED
(X) commiting registry
(X) shutting down service manager
(X) cleaning up temporary directories
Exiting with exit code: 1000

*** end***

Sounds like progress....

Rich

On Nov 5, 2008, at 11:45 AM, Jared Rypka-Hauer wrote:

Rich

Jared Rypka-Hauer

unread,
Nov 7, 2008, 11:17:06 AM11/7/08
to model...@googlegroups.com
SWEET! Here's to hoping!

J

On Nov 7, 2008, at 8:10 AM, Rich wrote:

>
> J~
>
> I opened a case with Adobe about this issue and received word today
> from their engineering team that they can reproduce the issue, so it
> sounds like they'll work on some sort of a fix or patch.
>
> FWIW here is what looks to be the error code from the coldfusion_err

> log: ...

Tom Bishop

unread,
Nov 9, 2008, 3:15:13 PM11/9/08
to model...@googlegroups.com
Hi,
 
I'm trying to find any info about a presentation made by Todd Sharp at cf.Objective() earlier this year on the subject of Integrating ColdFusion 8 AJAX with Model-Glue Applications. Unfortunately, CFSilence, which is the only place that seems to have this info, is down at the moment.
 
Otherwise, any pointers to any resources about best practices with ajax and MG would be greatly appreciated.
 
Many thanks,
Tom

Jared Rypka-Hauer

unread,
Nov 9, 2008, 3:30:50 PM11/9/08
to model...@googlegroups.com
Briefly (I'm on my way out to go fishing)...

There are two common (and very different) approaches to doing AJAX with ModelGlue. Because the CF8 form tags can be bound to CFC methods that are marked access="remote" (via URL or dot.path.notation.to.CFC), or any other URLs or dot-path notation to a CFC method, eitherof the following should work. Since you're asking about ways to use MG with AJAX, these aren't the only ways to do it, but they're definitely the most common.

1) Set up an event that broadcasts messages and includes a view that formats the data as JSON or XML. Have your AJAX do a POST or a GET to that event and pick up the generated text as your result. This is good for small sites and simple tasks where returning a "view" of your data is good enough to be maintainable. It's also probably the fastest and most straightforward way to make it work. And, FWIW, since your data is being pulled by the model and spit out in either JSON or XML (which are both effectively text-based documents) I really don't feel that this violates any rules of OO programming or patterns. It's a perfectly valid way to pull a text-based representation of your data into your views via AJAX.

2) Use ColdSpring remoting to create remote proxies for model objects controlled by ColdSpring itself. This allows you to call any of your service methods on your service layer without changing the code in your services to allow remote calls. I don't know if you're familiar with them or not, but the essence is that ColdSpring will generate CFCs that you can use as a binding source in your AJAX code, and those CFCs will allow you to call any objects available within your ColdSpring config. More info on this topic here:

Either is good, 1 works best for simpler sites and smaller tasks. 2 is best for large, complex sites and takes a healthy degree of understanding to get it to work in the first place.

Laterz,
J

todd sharp

unread,
Nov 9, 2008, 3:46:09 PM11/9/08
to model...@googlegroups.com
I'll let you know when my host decides to fix my VPS - it's been down almost 24 hours now.

Todd

--
Todd Sharp
to...@cfsilence.com
IM:  cfsi...@gmail.com
Blog:  http://cfsilence.com/blog/client
Create A SlideCast!!!  http://slidesix.com
Share Your Snippets!  http://cfsnippets.org



--
Todd Sharp
to...@cfsilence.com
IM:  cfsi...@gmail.com
Blog:  http://cfsilence.com/blog/client
Create A SlideCast!!!  http://slidesix.com
Share Your Snippets!  http://cfsnippets.org

todd sharp

unread,
Nov 9, 2008, 9:09:30 PM11/9/08
to model...@googlegroups.com
http://slidesix.com/view/INTEGRATING-COLDFUSION-8-AJAX-WITH-MODELGLUE-APPLICATIONS

I don't have the code samples attached to that preso, they're on another machine.  I can get them to you tomorrow if you need them.

Thnx,

Todd

Jared Rypka-Hauer

unread,
Nov 9, 2008, 10:19:40 PM11/9/08
to model...@googlegroups.com
How dare you use a host that would EVER let your blog go down! People need your blog! ;)

J

Tom Bishop

unread,
Nov 10, 2008, 3:58:45 PM11/10/08
to model...@googlegroups.com
Thanks both Jared and Todd for your replies.
 
Any code samples would be most splendiferous if it's not too much trouble. It sounds like the ColdSpring remote proxy is the way to go for me...
 
Cheers,
Tom


From: model...@googlegroups.com [mailto:model...@googlegroups.com] On Behalf Of Jared Rypka-Hauer
Sent: Monday, November 10, 2008 10:20 AM
To: model...@googlegroups.com
Subject: [Model-Glue] Re: CF8 Ajax Integration with MG

Reply all
Reply to author
Forward
0 new messages