External access on MongoDB 2.6
This configuration was tested on MongoDB 2.6 and maybe not compatible with other versions.
Continuing a line of configuration of the post Creating admin user on MongoDB 2.6, now we enable external access to the MongoDB.
Like everything on Linux or most, there is a folder with configuration files or the configuration file is inside the /etc
folder. In this case the file name is /etc/mongodb.conf
.
Edit the bind
parameter to 0.0.0.0 (anyone connects) or to the specific IP you want to connect to MongoDB.
Restart the service for the changes to take effect:
$ sudo systemctl restart mongodb.service