Nodejs + + Apache


I installed nodejs via the virtualmin interface under public_html/nodejs and I use But I cannot get to work and I believe there is some issues with the Apache proxy that I need to configure. Here is what I have

var serverPort =3003
var http = require(‘http’);
var fs = require(‘fs’);
var server = http.createServer(function (req, res) {
fs.readFile(‘index.html’, function(err, data) {
res.writeHead(200, {‘Content-Type’: ‘text/html’});
return res.end();
server.listen(serverPort, ‘’);
var io = require(‘’)(server);
io.on(‘connection’, function(socket) {
console.log(‘new connection’);
socket.emit(‘message’, ‘This is a message from the dark side.’);

index.html (interalia)

Both index.html and server.js are in public_html/nodejs

This works on my local, obviously not here. This is the last message I had on the browser console:
[Error] Failed to load resource: The request timed out. (, line 0)

Also the proxy configuration in https.conf
<Proxy balancer://mongrel3003>
BalancerMember http://localhost:3003

ProxyPass /nodejs balancer://mongrel3003

Any idea of what I should do?

Many thanks,

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.