Sorry. But y'all have missed the point. It occurred to me that I may have been insulting with the previous sentence which was not what I wanted. so I am adding this: I like your answers. They are correct. But they missed some historical and general information in relation to having a host name and not necessarily having a domain name. Which is what I am trying to say here- albeit not as well as I would like.
Setting a host name for a server and as the question implies, for a web server, is simply to know, at minimum, what packets the server is to accept and respond to. Do not confuse the notion that a host name is for convenience only and that the IP address is the only important network setting. Not at all. Packet headers can be addressed with a host name, or domain name if Internet based, many more times than not if not exclusively.
When a request packet is made, often it is the host name or domain name that placed into the packet header. The address and routing information is secondary determined at another
network layer entirely and can change even while in route while the host name or domain name always remains the same short of a header rewrite via a proxy.
While it may seem trivial to add a host name and therefore not important, it is vitally important for networking and routing. This is why there are broadcasts on networks, to determine what host names have what IP addresses and MAC addresses and how to route any request to the right place. Again a packet is likely addressed by host name at minimum. Your router can now direct that request packet and your computer which then knows that packet is to be accepted and responded to.
Again, the host name is static addressing, while the IP address is, in network routing terms, dynamic addressing. Even when an IP address is statically assigned, in terms of network design, it is still a dynamic entity. It can be changed at any point.
I know some will argue with my premise, but often I see the concept reversed as it seems to be here. I am talking about network routing 101. Host names transcend all protocols while IP addresses do not. This means that no matter what network protocol is used, the host name remains the most important addressing mechanism. It just so happens that TCP/IP allows IP addressing at packet creation. I am not sure that such a mechanism exists in other protocols. I do not recall any.