Most people use ad networks and ad networks generally don't provide a way to get the ads on the server side. That would also be more complicated than sticking an iframe/script tag on the page for the publisher.
If you don't want to use a network, you have to sell the ads direct yourself - which isn't easy.