How do you prevent back pain due to standing for long periods of time?

Stretch. There are many studies on the subject of lower back pain. The majority suggest the best method of controlling chronic lower back pain is exercise to create core strength and loose weight. I also suggest daily stretching and core strength exercises. You can find these exercises at: http://harvardneurosurgeon.Com/pt2.Html.
Don't stand too long. You can try to change your foot position by resting one and alternating them on a book or footstool simulating a brass rail in a bar. Just walking a few steps periodically or squating can help. Some pelvic tilts can help as well as a simple elastic back support. Weight control, regular exercise and not smoking ( if you do) will also help. Sometimes a local heat application can help -otc patches.