2

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..?

2 Answers 2

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.

-1

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.

1
  • node.js is its own webserver. You can serve pages all day with just node - no apache, nginx, iis, or whatever.
    – NathanG
    Apr 20, 2012 at 22:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .