Old English hwær, hwar "at what place," from Proto-Germanic adverb *hwar (source also of Old Saxon hwar, Old Norse hvar, Old Frisian hwer, Middle Dutch waer, Old High German hwar, German wo, Gothic hvar "where"), equivalent to Latin cur, from PIE root *kwo-, stem of relative and interrogative pronouns. Where it's at attested from 1903.
It has figured in a great many prepositional and adverbial compounds through the years; in addition to the ones listed in this dictionary (whereas, wherefore, whereabouts, etc.) English has or had whereagainst, wherefrom, wherehence, whereinsoever, whereinto, wheremid, whereout, whereover, whereso, wheresoever, wherethrough, whereto, whereunder, whereuntil.