Legend of Mahaganapati Temple
Tripurasur was a the son of Sage Gritsamad. One day the sage sneezed and from this was created a young boy who the Sage brought up as his own son. The sage taught the boy the Ganana Twam, Ganesh Mantra. Equipped with this mantra the boy meditated intensely on Lord Ganesh who ultimately blessed him. He was given three pura-s of gold silver and iron. Since he was the owner of these three pura-s he was given the name Tripur. Ganesh also bestowed on Tripur to be the most powerful, who none but Lord Shiva himself could destroy and after being destroyed by Lord Shiva he would attain mukti-salvation.
This boon made Tripur proud and he brought havoc in the entire world. He conquered the Nether world and then proceeded to takeover Heaven. He defeated Indra the king of heaven. His aggression made Lord Brahma hide in a lotus and Lord Vishnu in the Shirsagar. He soon also took over Lord Shiva's Kailash Parvat and thus became the King of all the three worlds. The gods wondered on how to vanquish Tripurasur. Lord Narada told them that, since he had been granted a boon by Lord Ganesh himself it would be very difficult to vanquish him. He advised them to meditate on Lord Ganesh. Pleased Lord Ganesh decided to help the Gods.
Disguised as brahmin he visited Tripurasur and told him that he was a very enlightened Brahmin and could make for him three flying planes. Riding these he woud be able to go anywhere he wished within minutes. The planes could only be destroyed by Shiva.In return Lord Ganesh asked him to get him the statue of Chintamani which was at the Kailash Mountain. Lord Shiva refused to give the statue to Tripurasur's messenger. The angry Tripurasur himself went to get the statue. A fierce battle started between him and Lord Shiva. He destroyed everything that belonged to the Lord Shiva who too retired to the Girikandar.
Lord Shiva too realized that he was unable to destroy Tripurasur because he had not paid his respects to Lord Ganesh. He recited the Shadaakshar Mantra to invoke Ganesh. On doing so from his mouth emerged Gajanan to grant Shiva a boon. Shiva continued his invocation of Ganesh who ultimately directed him on how Tripurasur could be killed. Lord Shiva was asked to recite the Sahastranam and then direct an arrow at the three pura-s of Tripurasur.
Lord Shiva followed these instructions and finally vanquished Tripurasur.
The place where Lord Shiva invoked Lord Ganesh he also created a temple for him. The town surrounding this temple was called Manipur. The village Ranjangaon is considered to be the place where Lord Shiva himself sought the blessings of Ganesh and ultimately destroyed Tripurasur.