First thing that come up in my mind would be to go to single user mode where you will log in as root user. Then you can change the ownership on files in /var as they should be, but it will be a little tricky.
If you are using GUI for log in to the sytem, try to press ctrl+f1 and log in directly as root, if it will work you do not need to go to single user mode.
I would try to switch to console first and log in as root to prevent from rebooting the server.
You can then give all files back root ownership, but not all files are owned by root, there are files of other users like mysql if you have, etc.