If you don't have an outdoor ... the electrical boxes inside a hollow post, you can simply mount a weatherproof box on the side of a 4x4, as long as you protect the cable by running it in conduit ...