You're confusing ports, services, vulnerabilities, and exploits. So here is an analogy based on a house. You have a house (server) on a street. That house has three doors (ports), which lead to different places (services). Just because you have doors (ports), doesn't mean someone is going to walk in and steal your jewelry. Ports are opened because a service needs them to be opened for interconnection between a client, and a server. Not all services are vulnerable, and even those that are vulnerable, aren't exploitable.
For example, in the house analogy, having a door is a vulnerability however, having a door which leads to say another locked door in a foyer removes the exploitability of a thief getting ahold of your jewelry. There can be other parameters: A thief GETS IN the door, but is now trapped in a foyer, and also staring down a vicious dog (honeypot, jailed environment). Get the picture?
If you're concerned about running a webserver, spend some time looking at the versions of software you're going to use, then look for exploits, and or vulnerabilities at NIST using a CVE search. Otherwise the approach you are taking is wrong. Just because you have a house with windows, doesn't mean someone is going to, or can break them, walking away with the keys to the kingdom like Ocean's Eleven