Is there a way to tar a compiled apache/php installation and move it to another identical server?

If I specify all the configure options for both apache and php to point to /usr/local/apache2 and then tar apache2 and untar it on another server will everything work just like it should? Or do I need to compile from scratch onthe second server.

Has anyone done this before and what is the best way to do this.