DO NOT mount an amplifier on your subwoofer box. I know that there has been a great deal of discussion over mounting an amplifier to an enclosure and many people do it all of the time with no problems but those people probably build good enclosures from 3/4" (or thicker) MDF with extensive bracing. Most people (especially young impatient people) are too lazy to do that and build unbraced enclosures from 5/8 MDF. These enclosures will flex considerably more than a proper enclosure and will likely cause amplifier failure if the amp is mounted to the enclosure.
When the woofer(s) moves in or out, the box flexes and therefore causes the sides of the box to vibrate. This vibration is transferred to the amplifier mounted to the box. All of the electrical components in the amplifier have mass. Inertia (an object in motion tends to stay in motion, an object at rest tends to stay at rest) tells them to stay at rest, the box vibration is trying to make them move. The energy from the box's vibration is transferred to the components through the electrical leads which are soldered into the circuit board. All of this will cause the components to break loose and therefore cause the amplifier to fail prematurely. Basically, the amplifier will commit suicide! :-) I'm not telling you this because someone told me it was bad. I've been repairing amplifiers since ~1985. Virtually every amplifier that's come into my shop with parts rattling around inside them have been mounted on the speaker box. It causes the legs of the semiconductors to break (which causes amplifier failure). It causes the capacitors to break off of the board (which can cause catastrophic amplifier failure). It causes solder joints to break on the semiconductors mounted to the heat sink. It causes transformer windings to grind into one another (which causes lots of smoke to pour out of your amplifier). People who repeatedly tell others to mount their amps on the speaker box because they've never had a problem remind me of people who drink and drive and say there's nothing wrong with it because they've never crashed their vehicle. Eventually, in both cases, problems will arise.
Mounting the amplifier on the enclosure also allows someone to steal BOTH your amps and speakers at the same time with no extra effort. It's bad enough to have one or the other stolen but losing amps and speakers (and anything else mounted to your speaker box) is really gonna suck.
Now for those who absolutely have to mount the amplifier to the enclosure:
The top of the enclosure has been removed to show the bracing.
Absolute Worst Situation:
This diagram shows the amplifier mounted in the center of the largest wall of the enclosure. You will notice that there are no braces under the amplifier's mounting points (red arrows). Because this part of the enclosure will flex more than any other, this will cause more physical stress (from panel flex and vibration) to the amplifier than any mounting position. This would be made even worse because the enclosure has no center brace/divider.
Somewhat Better Position:
As you can see, this enclosure has a center brace which will help to reduce panel flex. You should also notice that the amplifier's mounting points are very close to the braces or on top of the wall of the enclosure. These points will have less vibration from panel flex (when compared to points farther from the dividers or walls).
As good as it gets (with amp on box):
This method of mounting will relieve most of the stress from the amplifier because the wood braces will connect the top of the enclosure to the bottom of the enclosure and won't allow the panel to flex. The braces should be glued (with a good wood glue) and screwed on both ends. The other mounting points are directly on top of the walls or dividers which will vibrate VERY little when compared to the an unbraced panel.