Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering if nodejs depends on apache common/util files? As I remember php requires and depends on some apache common files.

So the question is: Does nodejs has built-in web serving functionality as apache software and therefore does not need apache installed on the server?

UPDATE: And more general question is does PHP or nodejs or similar software can be a web server just by themselves without any web server software like for example apache? Maybe let's say by using HTTP library extention in case of PHP, however it seems like that library uses some shared objects of web server software, so it's already not pure PHP..?

share|improve this question

The first example on is a webserver. So, node does not need an external web server as there is a webserver written in node. Putting another webserver in front of it might eliminate some of its touted scalability.

PHP is usually run with a webserver (perhaps the Apache webserver) which was how it was designed to be used from the beginning. There might be a webserver written in PHP (it doesn't seem impossible...) but as far as I know it is not a popular solution.

Regarding "similar software", Tomcat has a built-in webserver but it's popular to put it behind another webserver. Most Common Lisp application servers I've seen are full-fledged webservers but it seems nonetheless popular to put another webserver in front of them.

One advantage of putting a traditional webserver in front of the application server is that the more traditional webservers are usually much better optimized for the serving of static files than most application servers, so you use each server to its strengths.

share|improve this answer

Neither PHP nor Node.js require Apache, but both require a webserver.

A webserver executes the PHP/Node.js code for each request, and delivers a response based on it. PHP can be run via mod_php inside of Apache, or via FastCGI with LigHTTPd or nginx, for example.

share|improve this answer
node.js is its own webserver. You can serve pages all day with just node - no apache, nginx, iis, or whatever. – NathanG Apr 20 '12 at 22:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.