Access an AngularJS app running on mac from IE in VirtualBox - angularjs

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

Related

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

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.

How to open localhost:8080 in Cloud9 IDE?

I am developing an app engine project (golang) in Cloud9 IDE. For testing in desktop i would go to localhost:8080 in my desktop browser.
In Cloud9, I tried https://workspace-username.c9.io with $PORT set as 8080, but somehow its not working for appengine project. But it is working for normal go web project though.
How do i test app engine application in Cloud9 IDE? or
How do i open http://localhost:8080 in Cloud9 IDE?
Available ports on a hosted Cloud9 workspace
If you're developing a server application, please note that you need
to listen to 0.0.0.0 ($IP) and 8080 ($PORT). Listening to this port
will enable your app to be viewable at https://-.c9users.io
You can also bind to ports 8081, and 8082, which can be accessed by
https://-.c9users.io:8081 and https://-.c9users.io:8082 respectively.
Please note that 8080, 8081, and 8082 are the only available ports on
a hosted Cloud9 workspace.
How to connect to the process running on 'localhost' that is inside of cloud9 server
I see some users are looking for the answer for this, So here is how to do it.
instead of "goapp serve" use "goapp serve -host 0.0.0.0"
credits to Cloud9 support team.
For Google App Engine running Python, the command would be
dev_appserver.py app.yaml --host $IP --port $PORT --admin_host $IP --admin_port 8081
You can also specify the admin host/port. Since Cloud 9 allows access to 8081 and 8082, you can use either of those as your admin ports. For me, the admin console did not open with the Cloud9 preview, but did open in a new tab within my browser.
$IP and $PORT are both environment variables for Cloud 9, with the values of 0.0.0.0 and 8080 respectively.
Edit:
With the most recent gcloud update (March 2018), you don't have to change the IP or PORT, but you do need to figure out how to work around the host whitelisting issue.
My non-ideal workaround is to add a flag to not check for hosts --enable_host_checking=false.
dev_appserver.py app.yaml --enable_host_checking=false
There's an unanswered Cloud 9 post around this issue (link to c9 forum). My guess is that you can add $C9_HOSTNAME as the host, but that doesn't quite work for me.
Interactive Console
If you want to use the interactive console you need to assign the admin port and also use the `--enable_console' flag.
dev_appserver.py app.yaml --enable_host_checking=false --admin_port 8081 --enable_console=true

I can't access to my web app with kitchen instance

I using Test-Kitchen and Vagrant to do integration test on my cookbooks. But when I use kitchen login and enter into my VM to proof manually the status of apache2 service (I'm on ubuntu 12.04) there is not problems, it service is running but when I try to access from my host in this way
http://localhost:8080
and it not respond.
And it is my .kitchen.yml
---
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
- name: ubuntu-12.04
driver_config:
box: "ubuntu-12.04"
suites:
- name: default
run_list:
- recipe[web::default]
attributes:
My doubt is about if is necessary to configure something else on kitchen.yml, maybe something relative to netwotk..
You need to configure the port forwarding, or (IMHO a better option) a separate network interface with known IP address which you can use to connect to directly from the host.
For example:
driver:
network:
- ["private_network", { ip: "192.168.33.101" }]
See the kitchen-vagrant and Vagrant docs for more information.
Also make sure that apache binds to that (or all) interfaces. The same with port forwarding, as it will point to the default NAT interface, not to the loopback.

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