Choosing a university is not very important for this. Any accredited undergraduate institution will do, though you should probably choose one that has an education school so you do not have to transfer after getting your bachelor’s.
While an undergraduate, you should major in history. With laws like the No Child Left Behind law, there is a strong emphasis on teachers who are “highly qualified,” which means majoring in the subject is important.
If you are capable of this, you should minor in something that is very different from history; something like math or science. Math and science are much more in-demand fields and you will find it easier to get a job if you can teach in these fields. Also, try to be able to coach a sport or to supervise some sort of extracurricular activity. You might well be required to do one of these things and you will look better to employers if you have a record that indicates that you’re particularly qualified in one or more areas.
Outside of that, simply work hard and try to impress as many people as you can. Observe as many teachers as you can and do whatever you can to help them while you are there. Make contacts so that you will have people in your corner when it comes to looking for jobs.