right amps have a power and a remote, the remote is what you wire up to the headunit, which only switches the amp on when the headunit is on, or you could wire into the ignition, or even put your own switch on it so you can control it. The power cable is always wired directly to the battery, however put a fuse in the line within 50cm i think it is of the battery to protect it from overheating, most people also have another fuse box if they need to split the power to multiple amps, this is done at the amp end of the cable. Do not run your rca's on the same side as power as it can cause interference in the line. For the earth find a bolt within a short distance of the amp that goes into the body of the car remove the the paint from around the hole then using a ring terminal on the cable thread the bolt through the terminal and fit back into the body of the car.
oh and dont put the amp in the sub box