What is the meaning and origin of the phrase "Calm winds and following seas"?

I first learned of it in the last episode of JAG. Is it a greeting, a way of saying farewell, or something else? It seems to have a profound meaning among American sailors (i.e., U.S. Navy personnel).
6 answers 6