The best way to do it, is out of the tank of course.... which is usually never the case, there is some light for you.
There are many different types of epoxy for reef tanks, the problem is that the ones marketed for reefs cost an arm and a leg.
At Home Depot you can pick up a stickof what is called "Aquamend." Aquamend is a white putty that is basically the same thing as the 20 dollar sticks. Aquamen costs 4 bucks a tube.
At Micheal's, you can pick up a Metal and Jewelry Cyanoacrylate Gel for 3.99/20g in the adhesive section.
Basically what you do is take your frag out of the water, and clip the peg off with some bone cutters, or angled pliers so that you have a flat surface to glue on.
Get a small amount of putty premixed for this frag. The putty is easier to mix together if you dip it in your tank first, it also helps it not stick to your fingers as much.
Take a towel and bottom of the plug/disc so that the glue will stick to it... Apply a small amount of glue on the disc and blow on it to spread it flat against the bottom.
Now, with your putty ready, smash the ball of putty about halfway into the bottom of the frag plug. I usually pinch the tip of the putty after placing it on the disc to create a "nipple" of putty I can press into the live rock. Taking your finger, press a small flat on the end of the "nipple" so that you can apply more glue. Squirt a little ball of super glue onto the" putty-nipple flat" and blow the glue down again. Basically what you have now is a super glue and puttyburger, the super glue is the bread and the frag plug is your plate!(I'm such a moron)
Anyways, now it is time to mount...
I hope you have already decided where and how you want to mount your frag because time is ticking! One you introduce that epoxy to the water it will create a skin as it hardens.
Press your "fragburger" into the place you want it to be, keeping a finger or two on the plug, pressed it into the rock, use the other hand or another free finger to kinda spread the putty into the rock.... smoothing it down like a hill from the plug to the rock.... Be sure to seal most of it, but leave a small notch unpressed. The reason you want to leave the gap, is if in the future you want to remove the coral.. you need a play to pry it off(thanks myzislow).
You can mount a coral directly to your back glass if you wanted to.
A few extra tips:
-Take a stainless steel brush, and brush off the area about 10 minutes prior to mounting. Use a baster to blow crap out of the area also.
-liquid super glue can also be used. You will need a small cap or tray to pour the liquid in to dip with. Pour glue, dip bottom of disc in glue... blow on it or dip it in SW really fast... apply putty and then dip putty side in glue... done!