How to buy and/or download OS X Server 4
I would suggest trying to purchase Server 3.2.2 if you did not already have that since running Mavericks. Then look under purchases and if you can see the option to install macOS Server do that. On Yosemite it will ask you to install the latest compatible version Server 5.0.15. (I just installed Yosemite 10.10.5 and Server 5.0.15 on it). Server 4 however seems gone forever.

Reference:
https://support.apple.com/en-us/HT203137