It is possible, of course. If it were not possible there were no web servers, right?
You need to see if this is what you really want. Rarely is this necessary. But if you want to go ahead I say it's no easy task, mainly because it seems like you care about security. Making a secure server is extremely difficult and labor intensive, usually done by very experienced and dedicated staff.
There may be a solution that solves what you want without so much work. It is not best suited for high-traffic websites but solves specific needs. Microsoft has created something that does much of the work. It is a specification (OWIN) and implementation (Katana) of a server for use with .Net applications. I wrote something on this another answer . There are links to more information about the technology. Now there is also Kestrel which is the cross-platform implementation of OWIN.
But I reaffirm, I do not think you need any of this. A default server should solve what you need. What you ask for is the role of any server.