Addictive Software


var me = Random.shuffle(List("Developer", "Cook", "Geek", "Musiclover", "Engineer"))


Using apache webserver as a frontend for a node.js website

As I moved my blog from wordpress to node.js I ofcourse wanted to run it on port 80, as I already have apache running on my server using that as a frontend was obvious.

To get it running I needed to enable the proxy and the http handler for it:

a2enmod proxy
a2enmod proxy_http

Then I just changed the configuration to proxy to the host/port my node.js application is using:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName blog.addictivesoftware.net
    ProxyRequests off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    <Location />
        ProxyPass http://blog.addictivesoftware.net:4000/
        ProxyPassReverse http://blog.addictivesoftware.net:4000/
    </Location>
</VirtualHost>

Restarting apache:

/etc/init.d/apache2 restart

and that's it

comments powered by Disqus