This should be run on the OpenMage root folder
find ./ -type d \-exec chmod 755 {} \;\
find ./var -type d \-exec chmod 777 {} \;\
find ./var -type f \-exec chmod 666 {} \;\
find ./media -type d \-exec chmod 777 {} \;\
find ./media -type f \-exec chmod 666 {} \;