Get IP Addr or Hostname of CF server

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Get IP Addr or Hostname of CF server

    Hello,

    I need to write some ColdFusion code that will do things a little differently
    based on what ColdFusion server it is running on. Is there any way in
    ColdFusion you can get the IP address or host name of the ColdFusion server?
    As long as it doesn't return 127.0.0.1 and localhost ... that wouldn't be very
    useful.

    Thanks

    MikeB36 Guest

  2. Similar Questions and Discussions

    1. outputing field with spaces in name (bus addr)inmsaccess
      how to form the output for a field with a space in the name. Using MSAccess. <cfoutput> #members.# </cfoutput>doesn't work. Neither did about 5...
    2. ip addr changes on 5.3 but not on 4.8
      I'm running both 4.8 and 5.3 on two different boxes in my office. Both have specified in rc.conf their hostname and default router (a win xp box...
    3. Identify dhcp client to server using hostname
      I am trying to allocate ip-addresses on my local network using dhcp3-server. I want a couple of systems to have a fixed address, while other system...
    4. Site without link-bar and addr.-bar.
      "pejs" webforumsuser@macromedia.com wrote: I assume you mean the browser's default bars, and not something within your pages? If so, you...
    5. Sendmail 8.9.3 - need to remove hostname from @hostname.domain.com
      I just upgraded from 432 to 433. Along with this came Sendmail8.9.3. I have changed the new sendmail.cf file with the same changes as the previous...
  3. #2

    Default Re: Get IP Addr or Hostname of CF server

    I take it cgi.server_name doesn't help you?
    philh Guest

  4. #3

    Default Re: Get IP Addr or Hostname of CF server

    I just write the server name to a file called real.html in the root of
    the web site. It helps with the load balancer, since then I can tell
    remotely which server I'm actually on, and then in code I can use cffile
    to pull the data into a variable for my error handler and conditional code.

    If I wanted to be real tricky I'd have my onApplicationStart methods
    check the server scope to make sure a variable exists there with the
    contents of real.html so it's always available.

    I haven't yet figured out if it's possible to initialize variables in
    the server scope via a jrun or CF config file, or to have jrun/cf run a
    function/cfm/class at startup. (which would be ideal)

    Joe

    MikeB36 wrote:
    > Hello,
    >
    > I need to write some ColdFusion code that will do things a little differently
    > based on what ColdFusion server it is running on. Is there any way in
    > ColdFusion you can get the IP address or host name of the ColdFusion server?
    > As long as it doesn't return 127.0.0.1 and localhost ... that wouldn't be very
    > useful.
    >
    > Thanks
    >
    Joseph Gooch Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139