Connecting to Mongodb without Auth? - node.js

I have Mongodb installed on my Ubuntu server. I allowed the server IP in the database config file. Port 27017 is open. The auth is off on the database meaning everybody is supposed to be able to connect to it via this URI string using Compass:
mongodb://<server IP address>:27017
with all this conditions ongoing, I still cannot connect to db with this URI string. Why?

Related

MonogDB connecting to my local computer from ubuntu vps server but not connecting to server's MonogDB

I am troubling some problems when I am trying to connect my Nodejs app with MongoDB on the ubuntu VPS server. It connecting to my local computer's database when I tried from my computer, but when I tried from my mobile it returns a network error. The web is completely working well on localhost and on the server with my local computer's database. But not connecting with the server's database.
here is connection string: "mongodb://127.0.0.1:27017/dealerportal";

Can't access to postgreSQL server

I'm having a trouble which I can't connect to my database using IP Address. It works fine when I access it to my local but the problem is the other PC can't connect to my server. I've been using postgre v11 and navicat v12. Is there any permission to setup in my device in order that the other devices can access to my database? It would be great if anybody could figure out where I am doing something wrong. thank you so much in advance
You have to change the host settings of the database to access it from a foreign IP
I would look at two things if connections from remote hosts are being rejected.
First what is the value of the parameter listen_addresses in the postgresql.conf file? If it is set to:
listen_addresses='localhost'
It will be allow only local loopback connections. Change this (for example to listen on all interfaces) to:
listen_addresses='*'
Next, check the pg_hba.conf file has a rule to allow connections from your remote client. By default PostgreSQL will refuse these remote connections and they must be whitelisted. The following example entry would allow any user to connect to any database from 192.168.1.2 and they must supply the password
host all all 192.168.1.2/32 md5
Check out the official PostgreSQL docs for this at:
https://www.postgresql.org/docs/11/auth-pg-hba-conf.html

Connect to MongoDB database using mongoose behind a proxy

I am using mongoose to connect to my database in mongolab in my server.js file :
mongoose.connect('mongodb://MyUsername:MyPassword#ds089702.mongolab.com:89702/todo');
When i launch my server with node server.js command, i see this error in my terminal
failed to connect to [ds089702.mongolab.com:89702]
I am very sure that is just a corporate proxy problem, so I'm wondering how can I connect to my database over the corporate proxy using mongoose ?
Thank you!
I had the same problem and figured out a solution that worked for me.
Example mongodb URI:
mongodb://:#ds123456.mlab.com:37409/dbName
Use a proxy client (e.g. Proxifier).
Create a HTTPS proxy through port 8080 using your corporate proxy as the address.
Create a rule for mlab using your URI's port as the target port, which uses the HTTPS proxy you created above as its action.
Prioritize your mlab rule high in the rules list.

Setting up Azure VM for Neo4j (or any local database) [duplicate]

I have installed a Neo4J instance on my server on port 7474. My domain is also using that server and I want webadmin to be used remotely with a username and a password like this:
example.com:7474
Is there a way to do that? I could not find any guideline in the Neo4J documentation.
Did you get a chance to go through Neo4j Server Configuration documentation? It says:
#allow any client to connect
org.neo4j.server.webserver.address=0.0.0.0
This line in conf/neo4j-server.properties is commented by default and limits access to port 7474 to localhost or 127.0.0.1 (which probably is the reason why things work for your domain using that server and accessing Neo4j over localhost). Uncomment that line and it should make port 7474 accessible to everyone i.e. 0.0.0.0.
In order to secure your Neo4j server with an Authorization layer, you might want to refer Securing access to the Neo4j Server documentation.
In my case on ubuntu the line to uncomment was
dbms.connector.http.address=0.0.0.0:7474
File location
Ubuntu: /etc/neo4j/neo4j.conf
Neo4j 3.0.6

Setup MongoDB to be reachable from remote application

I have a web server that runs MongoDB. It will save some data that I need a second application installed in a different computer to be able to query on. The server with MongoDB is an Ubuntu, it will use Meteor (currently I'm just doing some tests, so I only have the MongoDB installed) and the other application is a NodeJS script with MongooseJS.
What should I do to setup that instance of MongoDB to be reachable from remote applications?
I'm actually finding it quite hard to understand and find information on the web. I tried
var connection = GLOBAL.database.host;
mongodb.connect('mongodb://'+GLOBAL.database.host);
But it's throwing an error Failed to connect to.... :27017
The host is a virtual machine on Koding that I set up to run these tests. How can I make sure Mongo is accessible and how can I ping it to see if the mongo is responding my requests?
By default MongoDB is restricted to allow connections only from 127.0.0.1 .
The configuration file of mongo is placed in /etc/mongod.conf. In that file you can find the following two lines:
# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip = 127.0.0.1
Follow the instructions and go on commenting the bind_ip line (use the # symbol). Restart MongoDB and try again.
Make sure that you can reach your server to port 27017 (is the port that MongoDB uses). You'll have to allow it in your server if you have something like iptables or allow it in any firewall you may have.

Resources