The secret to early survival against the AI is tower, and not rushing the age researches.
Be sure to have villagers going for the stones and build towers to protect every location that have them working, because the AI analyze the defense potential of each working zones, and if one does not have any defense, it will be exactly where the AI will launch his attack.
Especially in the prehistory ages, in which you often want to keep your ressources to advance quicker in ages, a mistake that you will always regret when the AI will then send lots of ranged and contact units early , hammering your poor tower-less and army-less base.
And don't think towers alone will keep you alive, you really need troops early too, because if you have only towers, you'll meet a whole bunch of AI Samson that care very few of towers shots coming your way and crushing your towers at the stone age.
Oh and start building temples until their area of effect protect all your bases, or you'll have some fun with the AI prophets.
And as you keep your defenses (that improve with the ages) , your base will stay well defended.
Once airplane comes into play, be sure to build DCA nearly everywhere.
reaching ww2 be very very carefull with some of the units that are invisible like the sniper, you need to spot them or they'll kill every worker without a problem, get dogs or balloons that are the only way to see those dreaded units.
In the early age, ressource gathering is very slow, for the food it's better to hunt animals and fish, it's much quicker than recolting.
Later, when you can build granaries (and so attach farms all around them), food will come very much faster, starting at the copper age