Copy link to clipboard
Copied
Hi,
I am new to coldfusion. I installed CF7 in multiserver configuration. I created two instances on same box and created a cluster. I can browse to the two instances seperately and thru the cluster.
I am having an issue. When I access instances directly the site is working fine, but when I access it thru cluster, the images, javascript are not loading. I am getting error on jjQuery also( jQuery is undefined error).
I might have missed a basic thing in the installation but do not know what.
Could anyone help me to resolve this issue?
Thanks in advance.
Copy link to clipboard
Copied
Where are your images and javascript files located on the filesystem? Are they located in the webroot of the webserver or are they inside the ColdFusion webroot? Can you explain the layout of the filesystemn of your webserver (Apache? IIS?) and CF server?
Copy link to clipboard
Copied
Thanks for your response.
The installation is a multierver configuration installation. IIS is the web server.
CFIDE location is:
C:\Inetpub\CFMX7\CFIDE
cfusion location
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion
Instance 1 file location
C:\JRun4\servers\AppnInstance1\cfusion.ear\cfusion.war\Application
Instance 2 file location
C:\JRun4\servers\AppnInstance2\ePermits1_2.ear\ePermits1_2.war\Application
Image files and javascript files are under Application folder.
C:\JRun4\servers\AppnInstance2\ePermits1_2.ear\ePermits1_2.war\Application\Images
C:\JRun4\servers\AppnInstance2\ePermits1_2.ear\ePermits1_2.war\Application\JS
Application components are located at c:\AppnComponents
If I browse each instance with its URL then it is ok, but when I access using cluster then it is not loading images and
throwing errors on javascript.
Thanks
Copy link to clipboard
Copied
By default the IIS connector is set up such that only requests for *.cfm and *.cfc are forwarded from IIS to CF. So when you request .js files, they will be handled by IIS and not by CF. So you have two options:
1. Move all your js, gif, png etc. files from the war file to the IIS webroot.
2. Add additional mappings to /WEB-INF/web.xml so requests for .js files are forwarded from IIS to CF too.
Copy link to clipboard
Copied
I think we can not move images and js to under Inetpub without making changes to the application. I do not want to change the applicaiton because it involves changin multiple places and risk.
I added the below mapping in C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\jrun-web.xml file but its not working. Is it the right place and right way to add mappings?
<virtual-mapping>
<resource-path>/Appn/images*</resource-path>
<system-path>C:\JRun4\servers\AppnInstance2\Appn1_2.ear\Appn1_2.war\Application\Images</system-path>
</virtual-mapping>
Copy link to clipboard
Copied
No, that is not the right place. Virtual directories tell CF where to look for the source. But to get there, you need to tell the connector to forward the request to CF first.
We typically add the mapping to the EAR file before it is deployed on the cluster. Not sure how the server rewrites that upon deployment, but what we add to web.xml to forward the js folder is something like:
<servlet-mapping id="prisma_mapping_6"<
<servlet-name<FileServlet</servlet-name<
<url-pattern</js/*</url-pattern<
</servlet-mapping<