Depending on the structure you can drill the rocks and insert plastic/acrylic rods into the holes to stop the rocks from shifting. Some people drill holes and use zip ties too. I use AquaMend two-part epoxy from Home Depot. It works very well on rocks and makes a strong bond. If the rock has been in the tank for a while then I use an old toothbrush on the area I am applying the glue to remove much of the algae first.
Mike