Last night, I set up a pomelo chat example on the public network. I still feel a lot of pitfalls. record it. First and last.
Endpoint: http://chat.xiaodao.co/
Procedure:
Prepare a host with a public IP address. I use the Linode1024 Ubuntu 14.04 LTS.
Here, according to my sub-IP Address: 178.79.185.180, and my installation directory/opt, You need to modify it on your own.
# Ssh connection, the following will prompt to lose the password ssh root@178.79.185.180 # install the relevant software apt-get install gccapt-get install gmakeapt-get install g ++ apt-get install makeapt-get install git # get node Code cd/optgit clone https://github.com/joyent/node.gitcd node # This checkout is very important, if you try the latest version, it seems that git checkout v0.10.29-release # cannot install node. /configure -- prefix =/opt/nodejsmakesudo make install # Set the environment variable vi ~ /. Bashrcexport PATH = $ PATH:/opt/nodejs/binsource ~ /. Bashrc # install the required package npm install-g gypnpm install-g node-gypnpm install-g pomelo # Get the chat project code git clone https://github.com/ichenxiaodao/chatofpomelo-websocket.gitcd chatofpomelo-websocketgit checkout master # install the chat project needed package sh npm-install.sh # start game servercd game-server/pomelo start # start web servercd .. /web-servernode app. js # Open the following URL in the browser: http: // 178.79.185.180
# Tips
1. If there is A domain name, you can bind the domain name through the record;
2. Run the game sever command in the background: pomelo start-D;
3. Run node in the background. First install: npm install-g forever, and then use: forever start app. js when starting the web server.
Document Information
- Copyright statement: Free Reprint-non commercial-Non derivative-keep the signature | Creative Commons BY-NC-ND 3.0
- Http://blog.csdn.net/cdztop/article/details/35785213
- Last modification time:, January 1, June 29, 2014