I must be going blind because I can't see any palm trees. I think it's a long time since the Royal Navy had three funnel ships too. Maybe some ex-RN lads on here will have a bit more knowledge of that. As laurie53 has said already the chimneys on the buildings indicate that it could be nearer the northern hemisphere. They could perhaps be German? or even Russian. Can't see any sign of a white ensign anywhere. I've been in a few ports but don't recognise this scenery at all.
and my initial impression is that there must be some sizeable hills behind the camera judging from the angle of the shot. Unless It was taken from the air, which I would tend to discount given the level of flying and photography at around when this was taken-WW1 at the latest I would say.
I'll come back to this later when I have a bit more time.
Had a look at some of my 1960's photos of Gib and have come to the conclusion that this is Gibraltar probably around the First World War time. The inner jetty and some of the buildings were still present in the 1960's. If I'm correct the photo is taken from about where the apes are kept now.