Catalysis of the reaction: L-tryptophan + tetrahydrobiopterin + O2 = 5-hydroxy-L-tryptophan + 4-alpha-hydroxytetrahydrobiopterin + H2O.
L-tryptophan,tetrahydrobiopterin:oxygen oxidoreductase (5-hydroxylating)