Question
How to run nodejs with apache for ubuntu 12.04
Hello,
I’m trying to run an application in php with chat in nodejs and socket io
I follow this exemple https://github.com/hmagdy/ChatNodejsZendSocketio
My application has the same architecture and it works well in localhost, but i have some problem to deploy my application in the server.
I’ve tried this solution http://garr.me/blog/running-node-js-and-apache-together-using-mod_proxy/
But I got a “503 Service Temporarily Unavailable” error,
My virtual host config is
<VirtualHost *:80>
ServerAdmin admin@site.com
ServerName test.site.com
ServerAlias www.site.com
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://test.site.com:8080/
ProxyPassReverse http://test.site.com:8080/
</Location>
</VirtualHost>
My client.js
$(document).ready(function() {
socket = io.connect('http://test.site.com:8080');
blabla
And server.js
var app = require('express').createServer()
var io = require('socket.io').listen(app);
app.listen(8080);
blabla ...
Can you please help me to figureout what i’m doing wrong.
Thank you.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Generally a 503 error would mean that apache was unable to reach the nodejs service on port 8080. I would ensure that nodejs is listening and it might be worth changing your ProxyPass and ProxyPassReverse entries to use the IP address instead of the domain name to see if that resolves the problem.