Don't build granaries quite so fast.
Don't switch to advanced governments until you can ensure your people will be more happy (people get pissy faster in Republics and Democracies).
In less advanced governments, take advantage of martial law AND use forced labor to weed out the whiners.
If you're having trouble with happiness, go straight for techs that will allow the construction of wonders that improve citizen moods.
Get more and MORE luxuries! Not more of the same type, but more of varying types...the more differing types of luxuries you have, the greater their effectiveness.