Purana Jyotisha Sangraha · by Vyasa
Chapter 4 · Moon at Prabhasa, Mars at Kashi
शिवपुराणम् : कालज्ञानम् उत्पाताः ग्रहक्षेत्राणि च
ते देवाश्च तदा सर्वे ऋषयो निर्मलाशयाः ।स्थाप्य चन्द्रं प्रभासे च स्वं स्वं धाम ययुर्मुदा ॥ ३८ ॥
From the Shiva Purana, print Kotirudra Samhita ch 14, verse 38.
Then all those gods and sages, pure in mind, set the Moon in Prabhasa. They went happily to their own homes.
Simple meaning: The text says the gods and sages left the Moon at Prabhasa and went home.
चन्द्रेण च तपस्तप्तं षण्मासं च निरंतरम् ।
The text says the Moon did penance for six months with the Mrityunjaya mantra.
दशकोटिमितं मंत्रं समावृत्य शशी च तम् ।
The text says the Moon repeated the mantra ten crore times with a steady mind.
तं दृष्ट्वा शंकरो देवः प्रसन्नोऽभूत्ततः प्रभुः ।
The text says Shiva was pleased and appeared before the Moon.