ColdFusion 9, Tomcat 7, Apache and vhosts

拟墨画扇 提交于 2019-12-11 22:42:58

问题


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 root. 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?


回答1:


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




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/6435175/coldfusion-9-tomcat-7-apache-and-vhosts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!