How can it be related to firewall? Its whether allowed or not, isnt it?
As for the web server. I am running on apache2, are there some recommended options for php setup that might cause the problems? (ex. low memory limit)?
Also is there a possibility to somehow set a timeout on those ajax request (even in the code directly)?