I'm sure you've looked into it before, bu https://www.carbonads.net/ is a good starting place. There was another ad platform I had seen awhile back that shut down, that was very similar to carbon ads. The premise was pretty simple, it would be a script tag that would inject directly into the page. Essentially just an image wrapped in a link without any other tracking.
If you are looking to be a replacement for existing ad units, then you may want to look into IAB standards and ad sizes: 300x250, 300x500, 720x90, etc.
Good luck! It's a wild ride you are embarking on!
[1]
The main focus of this ad server was that it was selling impressions more than conversions, it had a focus on being more like a newspaper where you buy eyes on your ad vs looking at the conversion of clicks.
This was years ago, but I believe I remember seeing it was running on PHP, or at least appeared to be.