Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In ColdFusion, is there a way to determine what server the code is running on?

Is there any way in ColdFusion code to determine on what server the code is executing? I have few load-balanced ColdFusion servers. I want to be able to know on which server the code is running when I catch an exception, so I can include that information in the logging / reporting code.

The servers are Windows 2003/IIS, if that matters. I'd love to know how to do it in Linux/Apache too. :-)

like image 720
Patrick McElhaney Avatar asked May 06 '09 17:05

Patrick McElhaney


People also ask

How do you test a ColdFusion code?

To ensure that the code you wrote is working as expected, you view the ColdFusion page in a browser by going to the appropriate URL, for example http://localhost/test/mypage.cfm. If you are using the built-in web server, specify the port to use in the URL, for example, http://localhost:8500/test/cfpage.cfm.

How do I check my Java version in ColdFusion?

Open the ColdFusion Administrator. Log in. Select the "I" button for System Information in the top right corner of the Administrator. View the field labeled Version.

How do I start an admin in ColdFusion?

Once you have installed ColdFusion, you can access the ColdFusion Administrator via the following URL: http://{website url}/cfide/administrator (where {website url} is the name of your website's URL). This is the default URL - this directory and it's contents is automatically created when you install ColdFusion.


1 Answers

This may help you further...

<cfscript>
machineName = createObject("java", "java.net.InetAddress").localhost.getCanonicalHostName();
hostaddress = createObject("java", "java.net.InetAddress").localhost.getHostAddress();
</cfscript>
<cfdump var="#machineName#"><br />
<cfdump var="#hostaddress#"><br />
like image 162
Jayson Avatar answered Sep 21 '22 05:09

Jayson