If it's a VPS to which you have full access, it's good idea to backup /etc, /home, /var, /usr/local directories, and anything else that you had to change by hand. Other directories, like /usr are handled by the system's package manager and you don't need to have backups for them - when you will configure new machines, system will install all neccessary files for you.
*.so files are shared libraries, they are created at compilation time, and unless you changed the sources, you don't need to backup them. PHP configuration can be found in /etc/php?/* directories and files (on Debian, on Red Hat it should be in a similar place).
As for MySQL, it's good to make a text dump of the database using mysqldump - it will be easier for you to restore the databases in different MySQL instance which may by a different version, incompatible with files from the data/ directory.
Apache configuration should be kept within /etc directory, or within virtual hosts directories, which you should also backup.