Just make strong rules forbidding discussions of sex, unwanted advances, etc. This is a lot easier said than done. And what happens when they have been at sea too long, and some idiot decides to answer one of these questions in his own violent way. Yes, it already sometimes happens. As far as forbidding discussions of sex, forget it.
Guys talk about girls.
Guys talk about guys. Hey, I even hear that women talk about sex. I have probably been too graphic here, but everyone seems to look at the idealistic aspects of this instead of the reality. There is a reason none of the people who really understand the military want to go the openly gay route. And it isn't because they are all homophobes.