Indonesian quake survivors trying to ward off a second natural disaster have resorted to making special rice cakes to keep them safe from a nearby volcano.

In Central Java's Klaten district, one of the hardest-hit areas in the quake zone, residents are making the cakes, believed strong enough to prevent an eruption of smouldering Mount Merapi, the state Antara news agency said.

Wrapped in coconut leaves, the rice cakes are usually hung in doorways to ward off the evil spirits that could cause the volcano, which has been increasingly active since Saturday's quake, to erupt.

The amulets were used by villagers living on the slopes of Merapi last month, when authorities issued a volcano red alert.

Local resident Edy Santoso said people started producing the cakes after the circulation of rumours — and leaflets — saying Merapi would soon erupt.

According to local tradition, residents in the volcano zone should also bury seven items in their gardens and hang yellow palm leaves above the door.

The seven things were a 100 rupiah coin with a mountain pictured on one side, two leaves from a local plant, two rolls of thread, two cloves of garlic, two bananas, two pancakes and two bay leaves, Antara said.