开发者

ColdFusion 9, Tomcat 7, Apache and vhosts

开发者 https://www.devze.com 2023-03-14 08:59 出处:网络
I\'ve successfully managed to install CF9 (war) in Tomcat 7, linking the two via Apache vhosts. I\'m using ajp to proxy .cfm requests, and other rewrite urls to Tomcat 7 with Apache serving the rest o

I've successfully managed to install CF9 (war) in Tomcat 7, linking the two via Apache vhosts. I'm using ajp to proxy .cfm requests, and other rewrite urls to Tomcat 7 with Apache serving the rest of the content.

However, each vhost needs its own copy of the ColdFusion WEB-INF in the vhost ro开发者_如何学Pythonot. This works fine, but it has the side affect of each cf site having a unique instance of CF. The mappings, DSNs and all other settings are custom and not shared between the CF sites.

I'd really like to combine each WEB-INF so that they're is just one for my entire dev setup, kinda like how JRun4 used to work.

Any ideas?


I don't think this is possible with Tomcat as we have two separate instances and both separate installation files.


Have you tried replicating the virtual hosts in Tomcat also? I found this on the Tomcat wiki which sounds like it answers your question.

http://wiki.apache.org/tomcat/CreateVirtualHosts


Scott, I know this is an old thread. Did you manage to make it work, or even, is this still relevant? I was trying to do the same and found that you could make a symlink to the original ColdFusion context's META-INF and WEB-INF instead of copying the entire directory structures. Just remember to add allowLinking="true" in the <Host> tag in Tomcat's server.xml. So:

ln -s /path/to/tomcat/webapps/cfusion/META-INF /path/to/yourhost1/META-INF

ln -s /path/to/tomcat/webapps/cfusion/WEB-INF /path/to/yourhost1/WEB-INF

ln -s /path/to/tomcat/webapps/cfusion/META-INF /path/to/yourhost2/META-INF

ln -s /path/to/tomcat/webapps/cfusion/WEB-INF /path/to/yourhost2/WEB-INF

Basically all virtual hosts are indeed Java applications, but they share the same ColdFusion engine and ColdFusion meta-data so the DSN is shared across all hosts.

Now I'm not sure if above is a good practice, break anything, or worst, make kittens sad.

Any feedback is welcome.

0

精彩评论

暂无评论...
验证码 换一张
取 消