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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @ryanpq, Thanks for your response. May be my question is stupid, but How can i ensure that nodejs is listening on port 8080 ?
telnet IP_HOST 8080
Trying IP_HOST...
telnet unable to connect to remote host: Connection refused
Use apache as a reverse proxy for nodejs, serves static files from apache directly. Side note: IMHO apache is not the right front end for nodejs because it is not event base I use nginx instead. AFAIK the socket.io may not work behind apache, works perfectly on nginx You will need an upgrade for http protocol somewehere and some extra header to tell node that it stays behind a reverse proxy.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.