Serving Node.js on Apache

Ghost runs with Node.js but I can’t dedicate my port 80 to it completely. I run Apache to serve a number of other HTTP requests as well, so the best solution is to run Node.js on a different port and forward HTTP 80 from Apache to it.

A simple directive modification will be sufficient. Open your sites configuration file and insert the following proxy directives:

< VirtualHost _default_:80 >
DocumentRoot /home/www/
    ProxyRequests off

    < Proxy * />
        Order deny,allow
        Allow from all
    < /Proxy >

    < Location />
        ProxyPass http://localhost:3000/
        ProxyPassReverse http://localhost:3000/
    < /Location > 
< /VirtualHost >

This will also proxy folders, such as