hosting on webpack dev server accessing from parallels - webpack-dev-server

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.

Related

How send request from react native to local server

I am using android emulator and when i send request to localhost it gives me error. I have tried the forwarding the port also ngrok but none of them worked for me. It always gives me error.
[Error:Network Error].
IN Emulator go to setting->click on Network and Internet ->then select Internet->select available network and then re-run your project and check it will work
Please try http://10.0.2.2:8080 instead of localhost:8080. If you are referring your localhost on your system from the Android emulator then you have to use http://10.0.2.2:8080/ Because Android emulator runs in a Virtual Machine therefore here 127.0.0.1 or localhost will be emulator's own loopback address.
Original Answer Source

WSL 2 cannot conect to MongoDB

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.

Moodle unable to access using domainName

Installing MOODLE_33_STABLE origin/MOODLE_33_STABLE on Ubuntu 16.04.2
I am able to install it and , access it with my vm's ip,
but when i try to change
$CFG->wwwroot = 'http://ipaddress'
to
$CFG->wwwroot = 'http://somerandomname.com'
in config.php,
i am unable to access it using somerandomname.com in my lan.
i have also mapped the vm ip in hosts file of both apache2 and of the other systems in lan, still it shows HTTP ERROR 502, in chrome.
and Host not found when i check the chrome console.
if i am missing something guide me.
i want to access the moodle installed on my VM across my local connection with some domainname rather than the IP .
Thank you.
Sounds like you have to try classical debugging:
Try to access your moodle instance on the specific port, using eg. telnet
telnet somerandomname.com 80
Delete browser cache or open the URL in your incognito mode
Check the apache error log on Ubuntu: /var/log/apache2/error.log.
Check out further possibilities which are causing this 502 error:
https://www.lifewire.com/502-bad-gateway-error-explained-2622939

Access an AngularJS app running on mac from IE in VirtualBox

In our development environment we have our Angular app running on a Mac in development mode (grunt serve)
From a browser on the Mac we can access it with http://localhost:9000/
How can we access it from IE on a VirtualBox?
We are using yo angular generator Gruntfile.js
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
UPDATE:
The VirtualBox is installed, with Windows and IE, on the same Mac where I "grunt serve" and develop the Angular app
I can access the angular app from IE within VBox using URL: http://10.0.2.2
But something is still not working
1) In the Network panel
request.Name: livereload.js?snipver=1
request.Path: http://10.0.2.2:35729/
request.Protocol: pending
request.Status (Description): pending
2) In the Network panel there are no XHR requests listed
Maybe the problem is that the app is using REST endpoints which are on another server which is accessed through VPN ?
SOLVED:
The problem was not with V-Box network setup but with the way I was detecting localhost in the angular app (for DEV purposes)
I had:
var IS_LOCALHOST = (location.hostname.indexOf('localhost') > -1)
I changed it to
var IS_LOCALHOST = (location.hostname.indexOf('localhost') > -1) || (location.hostname.indexOf('10.0.2.2') > -1);
I use it for things like
var BASE_URL = IS_LOCALHOST ? 'http://dev.api.base.url' : 'http://' + location.hostname;
Where is the Virtualbox hosted? I'm assuming it's running some version of Windows since you ask about IE.
If the Virtualbox is running on the same host (physical machine) as the Angular app, it sounds like you need to set the VM to "host-only" networking mode.
See this: https://superuser.com/questions/303906/virtualbox-make-host-and-guest-os-talk-between-each-other
Once you have networking between the host and guest machines, you should be able to launch IE in the Virtualbox and type the IP address of the Mac and the port (:9000) and connect.
Make sure Grunt Serve is set to serve outside of "localhost." See this: Access node.js/grunt server through localhost:port on virtual machine
Also, make sure there aren't any firewall rules to interfere with requests to port 9000 on your Mac.
You can go to virtualbox network adapter settings for the windows OS and bridge both the connections. This way you will be able to access the angular app inside IE by giving the IP address, port of mac.
http://IP_OF_MAC:Port

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.

Resources