Some discharge from the penis is considered normal. The prepuce (the covering of the penis) typically will have a white-green discharge in most dogs, especially if they are not neutered.
If your dog seems uncomfortable, or is licking his penis a lot, there could be an infection. So, if he is not bothering it, I would recommend keeping the area clean. A warm washcloth (nothing on it), or a baby wipe could be used to clean up around the area, and also his inner thighs where the discharge accumlates when they lay down. Make sure if this is a long haired dog to keep the hair trimmed around the penis also, this will keep the bacteria down, and prevent infection also.
If he is acting uncomfortable/licking, you may need to see your vet for antibiotic treatment.
Let me know if you have further questions.
Yes, neutered dogs get it too, but in my opinion, there is not as much of the discharge when they are neutered.
Since this is a new development, you will want to keep an eye on it, and if it is worsening, bring him into the vet for an exam. Sometimes pieces of grass can get up in the prepuce (or other foreign objects) and create an irritation that causes the build up. The vet can flush out the prepuce, and examine the discharge and decide if any treatment is necessary. Oral antibiotics and flushes of the prepuce are the most common things used to treat infections.
If the discharge is minimal and not changing, most vets recommend simply keeping the area clean, and trimmed of hair. Watch for signs of discomfort or of the problem worsening, and get him in for an exam if this occurs.