ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

GetEnv Api To Retrieve The Instance Name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GetEnv Api To Retrieve The Instance Name

    Does anyone know of an environment variable name that I could use on the getenv api to retrieve the server instance name? For example, I have an instance named 'PROVATOSYS', which points to 75.149.125.34. I can use the variable "SERVER_NAME", but that will return the IP address. I can also use the "DOCUMENT ROOT", which returns "/www/provatosys/htdocs"

    I was hoping for a variable that would return the actual instance name of PROVATOSYS.
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

  • #2
    Re: GetEnv Api To Retrieve The Instance Name

    Instance_id??

    Comment


    • #3
      Re: GetEnv Api To Retrieve The Instance Name

      Originally posted by FaStOnE View Post
      Instance_id??
      I tried that, as well as Instance_Name and Sever_Instance with no luck.

      Somewhere I had a list of all the environment variable names, and I cant find it to save my life.
      Michael Catalani
      IS Director, eCommerce & Web Development
      Acceptance Insurance Corporation
      www.AcceptanceInsurance.com
      www.ProvatoSys.com

      Comment


      • #4
        Re: GetEnv Api To Retrieve The Instance Name

        I finally located the list of environment variables, and it's not listed. I found another post from someone who was trying to do the same thing, and it looks like they struck out as well.

        The Server_Name variable says that it will return the instance name OR ip address, but it always returns the ip address. I even added the instance name to the DNS file and restarted the servers, and it's still returning the ip address.

        I found a work-around. I can use the PATH_NAME to return the path ( /www/provatosys/htdocs ) and then strip out the instance name. It works if the default path is used in the apache configuration, as it will use /www/ (instance name ) / htdocs. It wont work if the default is changed from the instance name.
        Michael Catalani
        IS Director, eCommerce & Web Development
        Acceptance Insurance Corporation
        www.AcceptanceInsurance.com
        www.ProvatoSys.com

        Comment


        • #5
          Re: GetEnv Api To Retrieve The Instance Name

          Or you could search through all the members in the QUSRSYS/QATMHINSTC file looking for the string returned by the SERVER_ROOT environment variable. When you find it, the member name will be the instance name. You just have to remember to put SERVER_ROOT in all your configs just like DOCUMENT_ROOT.
          "Time passes, but sometimes it beats the <crap> out of you as it goes."

          Comment


          • #6
            Re: GetEnv Api To Retrieve The Instance Name

            Originally posted by littlepd View Post
            Or you could search through all the members in the QUSRSYS/QATMHINSTC file looking for the string returned by the SERVER_ROOT environment variable. When you find it, the member name will be the instance name. You just have to remember to put SERVER_ROOT in all your configs just like DOCUMENT_ROOT.
            Thanks! That would do the trick!
            Michael Catalani
            IS Director, eCommerce & Web Development
            Acceptance Insurance Corporation
            www.AcceptanceInsurance.com
            www.ProvatoSys.com

            Comment

            Working...
            X