The right way to upgrade PHP, Subversion, etc.?


Please allow me to ask this simple (for experts, not me) question here.
I have on my server a directory called ‘local’, that contains all the software that I installed: PHP, APC, Subversion, etc.
What will happen if I want to upgrade PHP or APC from 3.1.10 to 3.1.11, for example?

Now, in the /bin folder I have files from all software I use. Basically, I don’t know which file belongs to what software, since there are many.
Also, with new software versions, there a new file names created and some old ones deprecated.
What is the best way to keep track of all those changes, in order to efficiently remove all old files and keep only the new ones? I presume that when I do an upgrade, all old files with the same name will be overwritten by the new ones? Please confirm this.

Since I don’t have a lot of experince with Unix servers, I want to start organizing the server the right way. I use a shared account, but the host is giving me a lot of liberty related to server configuration.

Thank you for helping me with this matter.