Thanks for the offer! But I seem to have got it to work. I added this to the config.inc.php file so it wouldn’t try and find the details automatically:
$base_path = "/var/www/modx/";
$base_url = "http://www.mysite.com:47566/modx/";
$site_url = "http://www.mysite.com:47566/modx/";
That didn’t seem to work at first but when I turned the friendly URLs on and off it seemed to start put the port in the links and now its working like a treat!
But thanks for your help! And your offer of investigating it for me! I really appreciate it.