Node.js and Apache on the same server

What'd I'd like to do is have a node.js program be hosted in public_html/<appname> and be accessible by heading to domainname.com:80/appname - the server is Ubuntu 10.04, I'm using Apache as my HTTP server. Is it even possible?


Solution 1:

What you probably need is mod_proxy and ProxyPass for Apache.

Run Apache on port 80, and use the <Location> config in Apache to pass the query along to Node.js which would be on another port e.g. 8080.

<Location /<appname>/>
    ProxyPass http://nodejsip:8080/
</Location>