zone117x / node-open-mining-portal

A scalable all-in-one easy to setup cryptocurrency mining pool and portal written entirely in Node.js.
GNU General Public License v2.0
1.02k stars 1.03k forks source link

Create more user-friendly error message for when NOMP doesn't have permission to use port 80 for website #141

Closed mapleshadow closed 10 years ago

mapleshadow commented 10 years ago

events.js:72 throw er; // Unhandled 'error' event ^ Error: bind EACCES at errnoException (net.js:904:11) at net.js:1072:30 at Object.12:1 (cluster.js:592:5) at handleResponse (cluster.js:171:41) at respond (cluster.js:192:5) at handleMessage (cluster.js:202:5) at process.EventEmitter.emit (events.js:117:20) at handleMessage (child_process.js:322:10) at Pipe.channel.onread (child_process.js:349:11) 2014-05-05 17:21:19 [Master] [Website] Website process died, spawning replacement...

xxxxx@mpos:~/nomp$

PS: config.json

"website": {
    "enabled": true,
    "port": 80,
    "stratumHost": "localhost",
    "stats": {
        "updateInterval": 60,
        "historicalRetention": 43200,
        "hashrateWindow": 300
    },
    "adminCenter": {
        "enabled": true,
        "password": "password"
    }
},
mapleshadow commented 10 years ago

After the closed web, normal

ltcjuice commented 10 years ago

Only root can open ports under 1024.

Change to website port to one above that or run as root.

I changed to a higher port and used port forwarding on my firewall to redirect port 80 on the outside to the higher port number on the inside

ltcjuice commented 10 years ago

You better change your admin password too.

zone117x commented 10 years ago

I'll try to add a more user-friendly and useful error for when website process can't get permissions to listen on port 80.

LiveChains commented 10 years ago

you cant run on port 80 as a user it need to be root, our advice here would be to change the config.json port from 80 to something at the other end of the sale 25000 we used and then nginx to run on port 80, works a bit like i mirror, nginix will get the site from nodeJS.

There are SEVERAL reasons you would want to do this, almost all of them are security based, running the server with sudo (or root) shouldnt really be happening. This whole app can be download configured and run by a normal user on any 12x or 13x ubuntu

LiveChains commented 10 years ago

https://www.digitalocean.com/community/articles/how-to-configure-nginx-as-a-front-end-proxy-for-apache

When you get to configure apache pause for a moment, you dont need the apache but, but you follow its steps and apply them to NOMP

zone117x commented 10 years ago

There should be a more user-friendly error when this happens now. If the website module isn't able to start listening on the port it should output a more useful log message.

mapleshadow commented 10 years ago

Basically understand, thank you. Can I use sudo can be resolved? Or that you must use the root user to an entire folder into the / var / node / directory?

bitcoinbrisbane commented 9 years ago

I had the same issue. I solved by changing port to 8080 and the ip address in the config file to 127.0.0.1 and then ran as sudo.

sysmanalex commented 9 years ago

On Thu, Oct 22, 2015 at 9:30 AM, Lucas Cullen notifications@github.com wrote:

I had the same issue. I solved by changing port to 8080 and the ip address in the config file to 127.0.0.1 and then ran as sudo.

— Reply to this email directly or view it on GitHub https://github.com/zone117x/node-open-mining-portal/issues/141#issuecomment-150122103 .