I've traditionally deployed my sites under apache, simply by default. I've heard things about NGinX though and I'm wondering under which conditions it would be superior. In addition to apache and Nginx, what the other options are for webservers and what are their benefits?
One of the web servers used to have a large spike in load every few hours. After looking into the logs, I found out when the load spike happened, there where a lot of people looking at the gallery.
So I off-loaded 99% of the static content from apache to nginx. apache was left to serve all of the php. The load on my web servers dropped to a nice low number and with no more high load spikes.
If you are looking to get more out of your servers, definitely have some light-weight server serve all the static content.
Apache can be a bit heavy, and can fall over when under heavy load. There are lighter weight servers available, including nginx, lighttpd, and cherokee.
These lightweight options can be set up to serve static files quickly, and delegate dynamic server-side work to Apache.
There are a PILE of webservers out there. I expect depends on the usage you want. Apache will do most of what people want, it's known good, well updated, and will run on nearly any hardware and operating system combination.
For a comparison of web servers, check Comparison of web server software.
It really depends on what you're doing.
If you only have static content, you don't need Apache. nginx or lighttpd would serve you just fine.
If you have a mix of static and dynamic (well, Perl or PHP), but a small site, you can still get by with one of those alternative plus FastCGI, or just throw the whole thing into Apache.
If you're serving Ruby along with your static content,
mod_passenger in Apache should serve you well, with nginx/lighttpd/etc serving your static content.
For Python (my area of expertise), you can have Apache use
mod_python if you want but prepare for slowness.
mod_wsgi is better but you still have the overhead of Apache, which is fine if you have a lot of heavy dynamic traffic. Apache is a heavy lifter most of the time.
If you don't have a ton of heavy traffic, look into new systems like
uWSGI or the all-in-one server Cherokee to handle your Python. Cherokee handles static files, too. The rest, you'll still want to use nginx/lighttpd to serve the static content.
Java and other languages, I have no idea about.
The great thing about using nginx, though, is that it's amazingly configurable. So set up a couple of static servers with different subdomains, one each for CSS, images, and JS. That way you help avoid the limit of 2 files per domain at a time. Set up several servers and then set up an nginx proxy/load-balancer in front of them to make sure all of your static content is always available.
Basicaly, YES, look at more than just Apache!