在我的服务器上安装/设置Socket.IO [英] Installing/setting up Socket.IO on my server

查看:129
本文介绍了在我的服务器上安装/设置Socket.IO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我已经阅读了Socket.IO文档,我仍然有点不确定几点:

Ok so I have read through the Socket.IO docs and I am still a little unsure of a couple of points:

文档说......

要运行演示,请执行以下命令:

To run the demo, execute the following:

git clone git://github.com/LearnBoost/Socket.IO-node.git socket.io
cd socket.io/example/
sudo node server.js

现在我不知道这意味着什么!我认为它可能是命令行界面。我当然可以在我的本地主机上访问它,但我的在线主机包是一个共享的LAMP设置。意思是我无权访问root命令行(我认为)。

Now I don't know what this means at all! I think it may be command line interface. I of course have access to this on my localhost, but my online hosting package is a shared LAMP setup. Meaning I don't have access to the root command line (i think).

如何实际设置socket.IO,我的共享服务器包是不可能的?

How do I actually setup socket.IO, is it impossible on my shared server package?

感谢任何帮助......

Appreciate any help...

W。

推荐答案

如果您不熟悉node.js或基本的命令行用法,那么我建议您使用托管的WebSockets解决方案,如 pusherapp 。试图同时学习WebSockets,Node.js和Linux命令行会导致很多挫败感。看看pusherapp的快速入门指南,它很容易上手。您可以免费与一个应用程序同时连接5个(我与pusherapp无关)。

If you aren't familiar with node.js or with basic command line usage then I would suggest that you use a hosted WebSockets solution like pusherapp. Trying to learn WebSockets, and Node.js, and the Linux command line all at once is going to lead to a lot of frustration. Take a look a pusherapp's quick start guide, it's very easy to get started. You can have 5 simultaneous connections with a single application for free (I'm not affiliated with pusherapp).

已更新(内联答案为问题):

Updated (with inline answers to questions):

如果您打算运行Socket.IO应用程序的方向:

If you are going to go the direction of running a Socket.IO application:


  • 您在技术上不需要git,因为您可以从github上各自的下载链接下载node.js和Socket.IO。

  • You don't technically need git since you can download node.js and Socket.IO from their respective download links on github.

您实际上不需要LAMP服务器来使用Socket.IO。默认情况下,除WebSockets服务器外,Socket.IO还可用作简单的Web服务器。如果你想要服务器端脚本,那么你可能希望Apache使用mod_php,mod_python等。

You don't actually need a LAMP server to use Socket.IO. By default Socket.IO functions as a simple webserver in addition to a WebSockets server. If you want server side scripting then you might want Apache with mod_php, mod_python, etc.

从技术上讲,你不需要专用服务器甚至root权限。您确实需要一个可以长时间运行的系统。如果您希望在重新引导系统时自动启动该服务,您可能希望将启动文件添加到/etc/init.d,/etc/rc.d,这将需要root访问权限。 node.js和Socket.IO都可以从普通的主目录安装和运行。如果你想在标准端口(如80或443)上运行Socket.IO,那么你需要以root权限运行它。

You don't technically need a dedicated server or even root access. You do need a system where you can have long running process. And if you want the service to start automatically when the system is rebooted, you probably want to add a startup file to /etc/init.d, /etc/rc.d which will require root access. Both node.js and Socket.IO can be installed and run from a normal home directory. If you want to run Socket.IO on a standard port like 80 or 443 then you will need to run it with root privilege.

Node.JS相当规模那么Socket.IO也可能很好地扩展。

Node.JS scales quite well so Socket.IO will probably scale pretty well too.

让所有设置和工作都不是一件简单的事情,但如果你的目标是一个免费的解决方案对于网络服务+ WebSockets然后Socket.IO可能是至少探索你是否勇敢的好途径。

It's not a simple matter to get everything setup and working, but if your goal is a free solution for web serving+WebSockets then Socket.IO is probably is good route to at least explore if you are brave.

这篇关于在我的服务器上安装/设置Socket.IO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆