As always, there's more than one recipe... the following was taken from "Keo's Thai Cuisine", by Keo Sananikone, who owns a chain of Thai restaurants in Hawaii.

The recipe looks like it's spicier than the one listed above in this node. It also appears to have a number of harder-to-get ingredients. I would be very interested for someone to try both recipes and compare the two.

15 to 20 fresh small Thai green chile peppers
4 stalks fresh lemongrass, coarsely chopped
3 shallots, thinly sliced
1 clove garlic
1 tbsp kha (Thai ginger), coarsley chopped
1 tbsp krachai (lesser ginger), coarsley chopped
5 kaffir lime leaves, coarsley chopped
1/2 tsp kaffir lime rind, chopped
1/2 tsp ground coriander
1/2 tsp ground caraway seeds
1/2 to 1 tsp fish sauce (depending on brand and personal taste)
1 tsp sugar
1/4 tsp shrimp paste (optional)
2 tbsp vegetable oil

If using a food processor, simply combine all the ingredients, and process until the mixture is smooth.

If using a mortar and pestle, combine all ingredients but the oil and work into a paste, then add the oil and mix in well.

Store in a glass container, and refrigerate. The paste should keep well for several months.