I usually use a "sandwich" of epoxy putty and superglue Gel. I found out when I first got started that epoxy alone, or supergel alone, doesn't work very well. For LPS and SPS frags, I dry off the bottom of the coral base (or piece of rock that it's on) with paper towel, mix a ball of epoxy putty, put an indentation in the putty, squeeze in a big blob of Superglue gel, and press the base of the coral into the putty and SG Gel. Then I make an indentation in the opposite side of the putty, put in another blob of SG Gel into that, and put it in the tank and slowly press it into place on the rock. After holding a few seconds it hopefully stays there till everything bonds. For corals on rock bases, I do the same thing. The combination of putty/SG Gel seems to work better, and the putty helps to conform to the irregular suface of the rock. It's not 100%guaranteed to work every time, but it's the best method I've found for me.
With branched SPS frags that are large enough, I find it often works better to use a coral clippers to cut it off of a frag plug, and do the above. It's always nice if you have a small hole in the rock to glue/epoxy it into.
Mushrooms with no rock or attached substrate need other methods, as they typically slime themselves loose from Superglue Gel.