4

I am trying to install SDL Web 8.5 micro services with a context URL like http://mainurl:port/contextPath/servicesname?

In documentation https://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/GUID-0CBD761A-DCD3-4504-A9B2-74C5538B8470 it is mentioned that server.contextPath should work to append contextPath but somehow it is not working. This seems like a standard spring boot property.

Can anyone suggest in case I am missing anything?

1 Answer 1

6

After playing with install scripts, I was finally able to install services with domain URL containing context path. To help others with similar requirement, I am writing the steps to install service with a custom URL:

  1. When services are installed as a window service:

Following changes required in installService.ps1

-Add spring boot variables to pass as a parameter while installing services.

#Spring boot properties to add to install on domain url containg context path
$serverContextUrl="--server.contextPath=/sdl"
$serverAddress="--server.address=www.mydoamin.com"

-Pass context path as a start parameters.

$arguments += "++StartParams=" + $serverContextUrl
  1. When services are installed as a standalone Windows process

Following changes required in start.ps1

-Add spring boot variables to pass as a parameter while installing services.

#Spring boot properties to add to install on domain url containg context path
$serverContextUrl="--server.contextPath=/sdl"
$serverAddress="--server.address=www.mydoamin.com"

-Include above parameter in arguments.

$arguments+=$serverContextUrl
$arguments+=$serverAddress

Similar changes are required in start.sh script file in case we need to install services on Unix machine.

3
  • Why do you need to edit the files? If you just pass them to the scripts, they will also end up in the StartParams argument. Oct 9, 2019 at 9:49
  • Ahh, yes. We can also pass them to scripts as a parameter while using that. In our case, we have it called from some other scripts which is finally called from Bamboo. So make it easy to manage we have updated the install script. Oct 9, 2019 at 10:04
  • Fair enough; you are, of course, allowed to edit the files to suit your needs. I just wanted to point out that the mechanism described in the documentation actually works fine. Oct 9, 2019 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.