Not able to access REST APIs hosted on ubuntu VM from windows browsers - laravel

I'm working on windows 10 and installed ubuntu virtual machine on it. In ubuntu VM, Laravel REST API service is running on port 80. When my front-end application (on windows browser) tries to call/access these REST APIs, the application is getting "503 Service Unavailable" as response. But if I try to ping to this server, it is sending and receiving some bytes of data. Only curl call and windows browsers are not able to access these REST APIs.
However, In another ubuntu VM (say vm2), if I try to fetch resource from these REST APIs, sometimes it works and sometimes it gets the response same as that of windows browser (503). This is a weird behavior on vm2, since it cannot be predicted when the API call succeeds and when not.
I have checked:
hosts file in windows
port-forwarding in virtual box
apache2 configurations
But nothing worked so far. Any help would be appreciated.
Thank you.

Related

Unable to access my spring boot API on another computer when its port is in use on that computer

I made an API on spring boot in one pc, and started it on localhost. I can access it on that pc and on any other pc using it's IP address.
However, I was got a time out error when attempting to access the API from a friend's laptop, and found out that he was running another spring boot api on the same port as the one my api was running on in my pc. After changing it, the api could be accessed.
I asked my project manager, and he says that this shouldn't happen, that there was no connection between the ports on my original pc and this one. However, this is practically not the case. Can anyone explain why this happened?

Laravel Homestead needs to access local web server

I have the following setup in my DEV environment which is running on Windows 10 (which should be irrelevant).
Homestead with Virtual box to develop my Laravel applications
on my local OS I have a IBM Domino server running as dev1.mydomain.local
I'm trying to access the REST API on the Domino server from my Laravel installations. At the moment I'm getting 404 errors when trying because the domino server is not available from within the VirtualBox of Homestead.
Here is the network configuration of the homestead virtual box
Both webservers Domino and nginx on the virtual box are running on standard ports
Here is the ifconfig output of the virtual box
How can I make that possible?
UPDATE:
It just came to me that I am able to access the Domino server with LDAP, so perhaps changing the http and https port of the Domino server is already the answer...
I will test that and then get back here...
Changing the Port of the Domino server to 8080 enable me to access the server's REST API
dev1.mydomain.local:8080/api/data/
The connection to the local machine seems to be enable through the VirtualBox's second network adapter and the my call to the REST API got confused with the 2 web servers listening to the same port on localhost(127.0.0.1)
Update
although I was kind of able to connect to the server using the address above, still left me with the problem that authentication wasn't possible. In order to do so (and I have not the slightest idea why), I had to change to the local IP address of my PC to access the REST services
http://192.168.0.155:8080/api/data
If someone could explain that I would be happy :-)

Apache Traffic Server transparent proxy (inline on a linux bridge mode) not work, any trouble-shooting advices?

I followed the steps strictly from the official documents here :http://trafficserver.readthedocs.org/en/latest/admin/transparent-proxy/bridge.en.html#inline-on-a-linux-bridge
then the Linux bridge works well, every app on the client PC can access the internet but the browser visiting http websites always gets timeout(https is ok).
the 3 processes traffic_cop, traffic_manager and traffic_server can be seen using "ps aux".
there is no access log file squid.log in the log path.
and the Wireshark on the PC using as bridge can not find any interfaces in this situation.

Work with Web API and Windows Phone

I am developing a solution that is composed of two elements: a web server, which publishes some REST services, and a mobile client, which consumes those services.
To implement the REST services I have used the Web API technology.
When I start the web project in debug, everything works fine. I can use the services by pointing to localhost:63954/api. A weird fact: if I change "localhost" with "127.0.0.1" or with the LAN address of the machine, 192.168.xxx.xxx, the server does not answer anymore!
Then, when I start the Windows Phone client, which runs in a virtualized emulator, it fails to connect to the web server! Even if the two components are running in the same machine.
Obviously, in Windows Phone I cannot use the "localhost", since the localhost of the phone is the phone itself. So I'm trying to use the 192.168.xxx.xxx address which is the address of the machine that is running the web service. But the mobile phone emulator fails to reach the webservice.
I need to run the Web Server in Visual Studio 2012, since I need to debug it, and to make it reachable from the Windows Phone Emulator, but I do not know how to do it. Can you help me? Any idea?
Thank you so much,
Riccardo.
EDIT: By following the link found here (Binding IIS Express to an IP Address) and by turning off my firewall I can run the web application outside VS12 and I can make it reachable from other pc in the network, and so also from the WP emulator. This could be a work-around, but I cannot debug the REST service in VS in this way and this is not good...
The Windows Phone 8 emulator works as a separate machine on your network, with it's own IP address and configuration. Therefore, for the emulator to be able to access your service you will need to make sure that the port you are trying to access is open for inbound connections.
As you mentioned the windows phone is running seprate in your client machine,One way of solving this problem is ,Binding your machine's Ip address to the Web Api,SO the Web api can be accessed using the Machine's Ip address.You can Bind the ip address to the project by using Microsoft Webmatrix.
So,You can access the web Api using the Ip address.Hope this helps.

Windows 7 running as server

I'm developing a program using Windows 7. There are WCF services (soap, rest) that are used by currently by Silverlight but very soon I'll start development of the mobile application that would make use of these services.
On day to day basis I use Mac and Apache to host my website, but during the development of this program I would like to use IIS7 to put my services online. I have absolutely no problems to access all the services via localhost but as soon as I'm trying to connect through the internet I get "The connection has timed out".
I'm sure that my router is configured right as it works perfectly fine when I'm on Mac OS, but it looks like Windows simply blocks incoming connections from outside; I cannot even connect from another computer on the same network.
So is there a way of using Windows 7 as server with IIS7 or is it only possible with Windows Server? I know it might be like enabling/disabling one setting somewhere but I just cannot find it.
Please help.
By default, the Windows 7 firewall doesn't have a port 80 exception for IIS, you will need to either add an exception or disable the firewall to be able to connect from another machine.
Windows has a built-in firewall that is probably blocking the connections. Type "firewall" into the control panel search box to find the settings to allow stuff through/turn it off completely.

Resources