proper file permissions for elgg installation directory?

To install elgg, I have to make both my elgg/ and data/ directories have full permissions (chmod 777). I assume data/ has to stay this way during normal usage, but does elgg/ ? I'd really rather not have the root directory of my elgg installation be completely world-writable, but when I tried: chmod -x and chmod a-x on it, my installation no longer worked.

 

What are the best file permissions to have for maximum security, but still actually having it work (of course)? Thank you!