I was dating my GF in college for 4 years. Then we went to different states (Me-med school, her-vet school). To make a long story short, we decided to do the following things: (1) Talk via phone every day no matter what (even for 1 minute to say "good night"). (2) Visit each other at least once every 6 weeks. (3) Take a vacation with each other for at least 5 days every year. (4) Spend all major holidays together. (5) Be completely honest with each other. (6) Avoid temptation.
#6 is particularly important b/c once you find yourself in a tempting situation, that reptilian part of your brain can take over - fast. So, I stayed away from places known for "hooking up." we all know which bars and clubs are just good spots to drink/dance/party and which are known for... well... you know.
My GF and I eventually got engaged, then married. We've been married three years now and have been in the same city for the past year (we actually got married while we were in different states).