Hello all, I've been asked by a work colleague to setup up a static apache server. I thought it should be an easy task so I d/led latest apache and compiled it with some static modules so it'll server static content only. Apparently, I was wrong. My colleague said that I compiled it wrong and it has no advantage over regular apache and will die as soon as there would be too many visitors. He also asked me the following question: And said that if I'll know the answer, I'll be able to setup static Apache correctly. Could you guys shed some light on the subject? Thanks a bunch!
I dont think that there is something like a static apache setup. I guess he meant a setup that is optimized to serve static content (e.g. plain .html pages or images) and not dynamic pages like perl or php pages. Apache is a system that can do nearly everything that a webserver can do, so apache is not specialized for a specific purpose. For websites which have high loads and serve a lot of static content, you separate the server part for static and dynamic content. For the dynamic content, you use a apache webserver. For the static content, you use a different http server like nginx or lighttpd which is much faster in delivering static files then apache. So when your collegue asks you to setup a webserver for static content, I recommend that you use lighhtp or nginx instead of apache. You can find tutorials for these two servers here at howtoforge and you should be able to find benchmarks which show the speed improvements over apache.
Thank you till, Here's another benchmark I found on the worl-wide-web http://nbonvin.wordpress.com/2011/03/14/apache-vs-nginx-vs-varnish-vs-gwan/ How about the question my colleague asked me?
I've answered the question above: So the answer to your collegue is: The servers get separated because it is faster to use a special purpose server for static content then running dynamic and static content on the same apache server.
What would be the best ./configure line for compiling Apache for static use? For example, Compiling with --with-mpm=worker option is a good choice because worker is fast and highly scalable and the memory footprint is comparatively low. It's well suited for multiple processors. What other options are must for better performance of a static setup?
This is what I came up with which is quite alright for a static apache configuration: Code: ./configure --disable-actions --disable-cgi --disable-cgid --disable-include --disable-negotiation --disable-userdir --enable-cache --enable-deflate --enable-disk-cache --enable-expires --enable-logio --enable-mem-cache --enable-proxy --enable-rewrite --enable-so --enable-headers --enable-nonportable-atomics=yes --with-mpm=worker