It's a broad topic and whole books have been written about it.
A web server, by definition, must respond to HTTP requests (TCP connections over port 80). It may also have to respond to HTTP/SSL requests (TCP connections over port 443). Of course it's possible to run these services over other ports; but publicly accessible web servers are almost all configured according to those standards.
So what are the sorts of security issues you can envision? Generally they can be vulnerabilities in the web server (daemon) code (e.g. Apache), in any of the modules being loaded by it (e.g. mod_php), in some of the dynamic content handling (CGI scripts being executed by the web server, Java, applications engines, etc), or in something else which is running on the server (SSH daemons, SNMP management agents, etc).
Additionally some issues can be beyond your own server. For example if you are processing data being supplied by users there's the risk that any router or link between your users and your server could be snooping for private or confidential data. Even if you process these over SSL you may have issues with users being redirected to other sites and being tricked into supplying that data to this "MITM" (man-in-the-middle). Also any content that is supplied by users and is displayed back to others (comments in wikis, blogs, messaging forums, etc) may be vulnerable to a variety of "cross-site scripting)" (XSS) exploits. An attacker may be able to inject bogus entries into various DNS servers which users are relying on to them them to your site (DNS cache poisoning, for example).
Realistically, most of the modern issues that are under your control are those related to XSS or to SQL injection (cases where your dynamic content is implicitly storing and retrieving data from a DBMS, such as MySQL, and where any of your attempts to sanitize user inputs are inadequate ... where user data is passed to the DBMS as a SQL code and executed there).
Those are the sorts of issues that are relevant to programmers. Most of the issues with OS, server software, and so on are of more interest to sysadmins.