hack.chat icon indicating copy to clipboard operation
hack.chat copied to clipboard

Can't creat custom domain

Open nguyenhopquang opened this issue 7 years ago • 6 comments

Well, i had installed on my own IP and it work perfectly, but i want to creat custom domain point to it. I had config the domain conf ( i use NGINX) like that:

server { listen 80;

server_name play.anonymousvn.org;
root /home/play.anonymousvn.org/public_html;

location / {
    proxy_pass http://104.238.134.38:8080;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}

}

and then t start the server with npm start, start the http-server. And then go to domain play.anonymousvn.org It had shown the client look like, but when i click to visit chat rom, it didnt ask me for my username, seem server.js didnt working, but when i go to ip 104.238.134.38:8080 it still working perfectly. Please help me

nguyenhopquang avatar Aug 14 '16 01:08 nguyenhopquang

try to add this to your nginx.conf

server {
        listen 6060;
        location / {
            proxy_pass http://104.238.134.38:6060;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        }
}

M4GNV5 avatar Aug 14 '16 01:08 M4GNV5

Can u help me via teamview?

nguyenhopquang avatar Aug 14 '16 01:08 nguyenhopquang

the server port is 6060 and the client port is 8080 yesterday, but today it changed to 8081

nguyenhopquang avatar Aug 14 '16 01:08 nguyenhopquang

Yesterday i typed npm start is okay, but today it get :

[root@vultr public_html]# npm start

[email protected] start /home/play.anonymousvn.org/public_html node server.js

Loaded config 'config.json' Started server on 0.0.0.0:6060 events.js:160 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE 0.0.0.0:6060 at Object.exports._errnoException (util.js:1012:11) at exports._exceptionWithHostPort (util.js:1035:20) at Server._listen2 (net.js:1252:14) at listen (net.js:1288:10) at net.js:1398:9 at _combinedTickCallback (internal/process/next_tick.js:77:11) at process._tickCallback (internal/process/next_tick.js:98:9) at Module.runMain (module.js:577:11) at run (bootstrap_node.js:352:7) at startup (bootstrap_node.js:144:9)

npm ERR! Linux 3.10.0-327.28.2.el7.x86_64 npm ERR! argv "/root/.bin/nodejs/bin/node" "/root/.bin/nodejs/bin/npm" "start" npm ERR! node v6.3.1 npm ERR! npm v3.10.3 npm ERR! code ELIFECYCLE npm ERR! [email protected] start: node server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script 'node server.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the hack.chat package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node server.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs hack.chat npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls hack.chat npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/play.anonymousvn.org/public_html/npm-debug.log

i still can go to play.anonymousvn.org but cant go to 104.238.134.38:8080

nguyenhopquang avatar Aug 14 '16 01:08 nguyenhopquang

Error: listen EADDRINUSE 0.0.0.0:6060 means that the port is being used by another process. So you'll have to either change the 6060 port to something else, or find out what process is using the port and terminate it.

$ netstat -tulpn | grep :6060

( if you can't figure out what process is using it, restarting the server works :) )

ToastyStoemp avatar Aug 14 '16 11:08 ToastyStoemp

Chances are, you've launched two instances of the server, and the second one is failing because it can't bind to port 6060 since the other one has taken it.

AndrewBelt avatar Aug 14 '16 20:08 AndrewBelt