The following is an excerpt from page 20 of the Warhammer Annual 2002 release with an expanded explanation by Gav Thorpe regarding targeting war machines with missile weapons and how to form up when charged.
I've been asked a couple of times whether the enemy need to be in range of the crew or the war machine to charge or shoot at them. I say that you need to be in range of at least one model in the war machine unit, but other than that, this can be the machine itself or a crewman (or an associated character).
When the crew forms up to receive a charge, treat them like a skirmishing unit. That is to say, the enemy charge the closest crewman and he aligns against them, then the other crewmen fall in beside or behind him as normal. If the war machine itself is being charged, move the closest crewman just in front of it facing the chargers and then proceed as normal (see diagrams 9 and 10).