Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

The first example on http://nodejs.org/ 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
add comment

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
add comment

Your Answer

 
discard

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.