Hello and welcome to e health forum.
From the description of your symptoms it seems that you might be having a prostatitis.
You might benefit by consultation with a urologist for a examination and proper assessment of your condition.
In the mean time, use of NSAIDs like advil or motrin might be helpful to control the pain.