I think g l a s s holes.com kits use the bulkhead to sandwich the back of the acrylic overflow box to the glass of the tank. You may want to look at a kit from them too as many people like them and their price may be reasonable close to the time/labor and headache of building your own.
Drill a hole in the back wall of the box and use a bulkhead to secure it in place. This is how the glass holes boxes work.
If it's just a 3-sided box (i.e. no back wall), then you'd have to adhere it to the glass. Aquarium silicone could be used, as could most aquarium safe epoxies. Some are easier to use/apply than others, some form stronger bonds than others.
ok what im thinking is doing a c2c overflow with bean animal pluming. the tank is going to be a peninsula so i want to put the overflow on the short side that will be against the wall. i thinking of a box thats 17x5x8.
Yep. The inner box won't hold much weight, so there won't be much stress on the bond between the box and the glass. The outter box is a different story (unless you plan to support it somehow), so you'll want to make sure you have a good, strong, water tight bond there.