We also had problems with a similar configuration and eventually and put
a master and query port in.
But should the ports be the same?
Should the ports be different from the httpd port?
Well we got it working with port 4444 for master and query and 8000 for
the Web server, but when we tried to go to client server configuration
we got a

jdbc.sql.SQLException: An IO exception was caught from a lower layer and
re-thrown.: java.io.IOException: Gateway connection refused: HTTP/1.0
502 Bad Gateway

Which port should be used in the applet?

SMR (Systematic Methods Research) -- http://www.smr.co.uk/
C, C++ and Java software services for Windows, Mac or Unix.
Phone: +44 (0)1273 544160