denied for socket: 0.0.0.0:80

63 views
Skip to first unread message

Pullan Lu

unread,
Sep 19, 2017, 4:07:38 PM9/19/17
to mongodb-user
Installed mongodb 3.2.8 on a dedicated CentOS 6 VM.
It works fine listening default port of 27017.
To pass existing firewall setting, I did the following on the host VM to use port 80 for mongod:
  1. Change /etc/mongod.conf
    net:
    #  port: 27017
      port: 80
    # bindIp: 127.0.0.1  # Listen to local interface only, comment to listen on all interfaces.

  2. disables iptables
  3. disables selinux
  4. restart mongod as root and got Permission denied for socket: 0.0.0.0:80 error shown in /var/log/mongod/mongo.log as below
    Enter code here...2017-09-18T02:29:22.826-0700 E NETWORK  [initandlisten] listen(): bind() failed errno:13 Permission denied for socket: 0.0.0.0:80
    2017-09-18T02:29:22.826-0700 E STORAGE  [initandlisten] Failed to set up sockets during startup.
    2017-09-18T02:29:22.826-0700 I CONTROL  [initandlisten] dbexit:  rc: 48

Any suggestion?

Rhys Campbell

unread,
Sep 20, 2017, 5:54:56 AM9/20/17
to mongodb-user
How did you restart mongod? I'd hazard a guess that a service init script is launching the process as mongod?

Wan Bachtiar

unread,
Sep 26, 2017, 12:00:42 AM9/26/17
to mongodb-user

Any suggestion?

Hi Pullan,

You should also check how you’re mapping the port between the host and the guest system.

You may also find Install MongoDB on RedHat useful for reference on installing/running MongoDB on CentOS/RHEL

Regards,
Wan

Reply all
Reply to author
Forward
0 new messages