It's always better to have separate instances for each web application than having the source code made to be available in the cfusion. Just follow these steps to get this going.
1. In the CF admin for your localhost, under the Enterprise Manager >> Instance Manager, create a new instance. After the instance is created you would notice the following information there
2. In this following path(Applications/ColdFusion11/{Instance name}/runtime/conf) you would find the server.xml. You would find this following tag towards the end of this xml file. Make sure you comment it out.
<!--<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="8500" executor="tomcatThreadPool" redirectPort="8443" connectionTimeout="20000"/>-->
3. In the following path (/Applications/ColdFusion11/config/wsconfig/1/) create this uriworkermap_{Instance name}.properties similar to uriworkermap.properties. Just replace the cfusion with {Instance name}.
4. In this file /Applications/ColdFusion11/config/wsconfig/1/workers.properties add one more set of records for the new instance you created.
worker.list=cfusion, {Instance name}
worker.cfusion.type=ajp13
worker.cfusion.host=localhost
worker.cfusion.port=8014
worker.{Instance name}.type=ajp13
worker.{Instance name}.host=localhost
worker.{Instance name}.port=8013 (The Remote Port number assigned to this instance when the new instance was created).
5. In this file /private/etc/apache2/mod_jk.conf, the new virtual host has to be created. Assumption is that, httpd.conf is configured for multiple instances. Refer
this for more information.
# New Instance
<VirtualHost *:80>
ServerName local.newInstance.com
JkMountFile "/Applications/ColdFusion11/config/wsconfig/1/uriworkermap_{Instance name}.properties"
DocumentRoot "/Users/test/Sites/newInstance" # This should be the path to Application.cfc
Alias /CFIDE "/Applications/ColdFusion11/newInstance/wwwroot/CFIDE"
<Directory "/Applications/ColdFusion11/newInstance/wwwroot/CFIDE">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
6. To provide necessary access to the document root, the following code can be added in the httpd.conf
<Directory "/Users/test/Sites">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
7. Add an entry in the hosts file (/etc/hosts) for this new site which has been created
127.0.0.1 local.newInstance.com
8. Now restart the Coldfusion and the apache. The following commands can be used.
sudo ./coldfusion restart (should be done from the instance/bin or cfusion/bin)
sudo apachectl restart
The CF admin should run successfully. Now configure the site by adding the necessary data sources, mappings etc to make the site work right.
Please comment here should you have any questions.