Lighttpd AND apache on the same server

apache-2.2lighttpdport

I've been thinking about running lighttpd for static content, but I'd rather not throw down the couple extra bucks to run the second box. Is it possible (and this is me going out on a limb) to run Apache on port 80 and lighttpd on another port (say, 81)? I know it would be better to just put it on another box, but I'm looking to do this on the cheap if possible.

Thanks

Best Answer

Changing the port that lighttpd listens on is pretty staightforward. Just change the "server.port" directive in "lighttpd.conf" (or wherever your OS decides to put the config for lighttpd).

Are you planning on adding a ":81" to all the URLs that refer to the lighttpd content?

If not, you should think about running lighttpd on port 80, moving Apache to another port, and proxying access to Apache through lighttpd. As has been discused on Server Fault already, running lighttpd as the proxy is preferred since it's "lighter weight" than Apache.

Of course, lighttpd isn't the only show in town. Some comparison between lighttpd, apache, and nginx has been the topic of conversation over at Stack Overflow. I don't use lighttpd and I don't know if the memory leak issues that I've seen mentioned in a couple of places have been addressed or not.