WSL 2 cannot conect to MongoDB - reactjs

I am developing a web app in my local using WSL 1 a while back. It works perfectly with MongoDB on local but after upgrading to WSL 2, I could not connect at all. I can still run the react app.
Here are some details:
Version: Microsoft Windows [Version 10.0.19041.172]
WSL 2: Ubuntu
How am I gonna call the MongoDB from the windows side from the WSL 2?

Mongodb listening on 127.0.0.1 by default.
You may want to edit your /etc/mongodb.conf to make mongodb listen on 0.0.0.0 so we can access mongodb from windows.
Or you can use this https://github.com/shayne/go-wsl2-host service to resolve your wsl 2 ip address to host name like ubuntu.wsl, then use that hostname instead of localhost

Try this
mongod.exe --bind_ip=0.0.0.0
OR with WSL IP
mongod.exe --bind_ip=192.***.**.1
Source

If you are getting authentication errors.
Go to task manager and stop all mongodb process & restart. I didn't have to change any ip or port.

Related

Ubuntu 18.04 issue with xrdp and user

Since morning I am facing some issue with the ubuntu xrdp. I have 3 users server, admin and root. server user is once which is configured during the installation. if is use root user then I am able to login but if I use other server its throw following error.
connecting to sesman ip 127.0.0.1
sesman connect ok
sending login info to session manager, please wait...
login successful for display 10
started connecting
connection problem, giving up
some problem
for admin user its show following error
Unable to determine failsafe session name. Possible causes:
xfconfd isn`t running ( D-Bus setup problem) environment variable $XDG_CONFIG_DIRS is set incorrectly (must include */ etc") or xfce4-session is installed incorrectly.
My Ubuntu version is: Ubuntu 18.04.4 LTS
It`s fresh setup and i also try to reinstall xrdp and its dependency packages but nothing works.
The output of $echo $XDG_CONFIG_DIRS is empty.
After digging in deep and doing lots of troubleshooting, I finally able to access RDP from other users also. I reinstall everything and then install vncserver and kill all the running process of xface from the terminal. Now it's working.

MongoDB Connect Fail Error in windows

I have installed MongoDB shell version v3.4.9 in windows 7 and when I type mongo in cmd then I get the following error
error see the screenshot
Please tell me how to resolve it.
I am a beginner in MongoDB.
Run a netstat -an from a Console window. Then locate the default MongoDB port 27017 in the output. If it's there you may have a firewall issue.
If it isn't then MongoDB is not running or not listening on the default port. In this case you want to either start the windows service if you've installed MonggDB as a service or manually run mongod. The following links provide some guidance around that:
How to install mongoDB on windows?
How do I start Mongo DB from Windows?

hosting on webpack dev server accessing from parallels

I am working on an app that for testing is hosted on web pack dev server.
I am using the following settings in my web pack.config file
devServer: {
host: 'mysite.local.co.uk',
port: '14500'
}
I have the following set in my hosts file on Mac
0.0.0.0 mysite.local.co.uk
I can now access the site on my Mac using http://mysite.local.co.uk:14500
I am trying to use a similar config to access the site from a windows 7 parallels desktop I have created.
I have done the following:
Set parallels network to shared
Set the hosts file windows to
[My Mac IP] mysite.local.co.uk
When I attempt to access the site from parallels I get no response
I have pinged [My Mac IP] and get reply's as would be expected.
I have tried setting host to 0.0.0.0 and as suggested here Github Issue
I am at a loss for how to make this work any suggestions would be greatly accepted
On macOS Mojave, go to Settings -> Sharing to see your Mac's network name.
It should say something like "Computers on your local network can access your computer at: YourComputerName.local". You can also change this name to something easier to remember and type.
On my Mac, this allows me to access my dev server via Parallels, Windows 10 and Chrome over port 8080. Not sure if the port matters.

Cannot access Jenkins

I have installed Jenkins on my Ubuntu 12.04 desktop machine using this guide:
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
I also needed to follow this guide:
http://aslamnajeebdeen.com/blog/how-to-fix-apache-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127011-for-servername-error-on-ubuntu
From my other machine (mac laptop) I now try to access Jenkins through safari:
http://192.168.1.100/jenkins
where 192.168.1.100 is the ip address of my desktop machine but I get an Error 404. I have also tried:
http://jenkins
but nothing happens. What am I missing?
The Jenkins service is running on my desktop PC:
service jenkins status
...
Jenkins Continuous Integration Server is running with the pid 3713
And if I enter: localhost:8080 in a browser on my desktop pc I get the jenkins web interface.
PROBLEM SOLVED:
I have followed this guide:
http://www.zzorn.net/2009/11/setting-up-hudson-on-port-80-on-debian.html
and it now works.
I had the same problem but not using Apache, rather only Jenkins on Ubuntu
I solved it by replacing HTTP_HOST=127.0.0.1 with HTTP_HOST=0.0.0.0 on /etc/default/jenkins
Jenkins is set to listen on port 8080 by default,
so you should point your browser to:
http://localhost:8080/
(or, in your case: http://192.168.1.100:8080/ )
EDIT:
If still not able to connect, you may wish to check your firewall settings.

could not connect to local host

Recently i installed apache tomcat 6 on my PC.I started the server and try to open the tomcat manager using the url:
http://localhost:8081/manager/html
8081 is the connector port i used at the time of installation and no other services using this port.But its shows the error like
Oops! Google Chrome could not connect to localhost:8081
I used this with differnt browsers IE and crome but still getting the same error
Please provide me the solving to getrid of this.
Try the "Test your Install" section here.
first make sure the your server is running correctly by connect to http://localhost:8081/

Resources