Server.Hostname

We have a conditional statement for months now that was always working properly. But now we discovered that its not working anymore because the expression $Server.Hostname$ returns "localhost" now instead of the real hostname "nemesis" (in our case).

Did you change something here? Any ideas?

You can force the hostname in the Continua.Server.Service.exe.config, add a key externalurl

[code] [/code]

You will need to restart the service after changing it (and possibly the website too).

under which node?

Sorry, should have said under continua-configuration

hm, the service won’t start anymore if i use this:

[code]…<modules><module name=“Continua.Modules.Builds.BuildsModule, Continua.Modules.Builds”/></modules><externalurl url=“http://nemesis”></continua-configuration>[/code]

Looks like I missed the closing / in my example

[code]<externalurl url="http://nemesis" /> [/code]

omg … did not noticed this :wink: … shame on me

it seems the last update removed this entry from config, don’t know why. just for your information. had to readd it.

Hmm… I suspect the installer is not aware of that setting. Will check tomorrow.

Hi Christian,

Apologies for the confusion but there are two related server variables which can be used in expressions.

$Server.Url$ gets its value from a server property named ‘server.hosturl’ which can be set under Administration  > Continua Server > Properties. This gets set by default to the

url value in externalurl node app.config. If this is missing it defaults to the base url of the first browser request to the web server e.g. “http://localhost”. We will however now deprecate the externalurl node as this value is always overriden by  the server property anyway. We have just noticed that the $Server.Url$ variable is not picked up by the intellisense, so you probably don’t even know this exists. We will fix this for the next build.

$Server.Hostname$ currently gets its value either from serverHostName attribute of the configuration\continua-configuration\endpoints node in the agent config file when accessed from the agent or from Environment.MachineName when accessed on the server. We will add a server property for this in the next build to allow the default value to be overridden.

Meanwhile please ensure that the serverHostName attribute in the agent config file has the correct hostname if you want to use $Server.Hostname$.