While all of these are great tips, I can personally vouch for lifting weights being wildly effective. I used to get lower back pain from sitting all the time. Once I started lifting weights the back pain basically just never returned. Haven't been lifting in years now but my back is still perfectly fine.
So if at all possible, see about lifting weights.