Make sure we're using the right environment
Set permissions on cache / logs