Hosting website on Azure Virtual Machine - apache

Yesterday I created an Azure Virtual Machine using the simple Win2008r2 + SQL2008r2 image.
I have deployed a website to the VM via an RDP session.
I am able to browse the website locally (via RDP) using
"http://localhost"
I understand that I need to add an Azure endpoint for port 80 to enable me to browse to the site from an external machine.
I have configured the Windows Firewall on the Azure VM to allow traffic on Port 80 inbound and outbound.
Could anyone please advise what I've missed or what I can do to troubleshoot?
---Update-----
I have learned a little more this morning. The website that I'm trying to host on the VM is an installation of Interwoven Teamsite v7.3.x. When I looked in IIS I could see that the "Default Web Site" was stopped. Another website called "TeamSiteSitePubPreview" had been created but was only bound to port 81.
So, what was presenting the website I could see when I browsed to
http://localhost locally?
I ran netstat -ano and this showed me that PID 1604 what listening on port 80. I then ran Process Explorer which told me that PID 1604 was allocated to "Appache HTTP Server".
I know nothing about About Appache, can anyone tell me if there's some Apache config that will be preventing connections from outside of the local server?

For reference, I just tested this sequence and it gives you a website accessible over the Internet:
Create a new Windows Azure virtual machine with the Windows Server 2008 R2 SP1 image.
Add an endpoint on public port 80, private port 80.
While the endpoint is being created, start setting the server up.
Remote Desktop in.
Add the Web Server (IIS) role with default settings.
Test the connection. You should get a HTTP 200 OK status.
If you want to troubleshoot your server, start checking for errors in the event log. Check also the website bindings in IIS (Port 80, IP Address *).
Also consider the connection issue might be on the client (your) side. For instance, DNS caching. Try connecting from another machine with direct Internet connection (such as another cloud server) or from a service such as isup.me.
Additionally, if all you want is to host websites in IIS, the Web Sites service has a more streamlined experience.

You will need to create an endpoint on port 80 thru Windows Azure Management portal as well. This endpoint opens a port in the Windows Azure Load-balancer.
Navigate to your VM within the portal and create a new Endpoint under the Endpoints screen of VM configuration within Azure management portal.

Related

Cannot access ASP.NET Core Web API from Windows-based Amazon virtual machine

I've been searching Google and StackOverflow about this for several hours now, and nothing seems to work.
I created a Web API server in ASP.NET Core and verified it works locally.
I created a new EC2 VM to host the Web API. I copied all the binaries for the API up to EC2, and started the server from the command line.
I have made sure that the required EC2 security group exists and that the correct TCP port is open for Input in the security group.
I have added an appropriate firewall rule to Windows firewall.
NETSTAT -Q shows that the server is working and that the port is in LISTENING mode.
I get the public IP address for my EC2 VM and go back to my local machine.
I use POSTMAN to submit POST requests to the EC2-based server.
POSTMAN returns an error: "There was an error connecting to ...."
So I'm at a loss as to what to do next. Have I missed some EC2 configuration? Is there something else I have to do to the ASP.NET Core WebAPI code?

Unable to connect to different HTTP port on server

I am new to WCF Services, I have developed a WCF service library hosted within a Windows Service. The service end point is http://servername:9980/ApplicationServer/ServiceName.
When I run this service on local system and try to connect using my application, everything works fine.
The problem starts when I deploy this service on server system, none of my application can use this service, even the browser says page not found. Though, if I remove the specific port number from the endpoint all works well.
I have already opened all the ports in Windows Firewall including Client and Server. Also proper exceptions are made to the router firewall, still I am not able to host the service on specific port. I have even tried by switching firewall off on both client and server system.
Thank you in advance.
-Ashish Sharma
When you remove the specific port number it defaults to port 80.
So there is something that is blocking the other port.
Try using the Telnet command to check if the port is open (you may have to enable telnet)
As you have allready checked the firewalls, it could be urlscan or a network device.

How can I Publish my WCF Service?

I want to use my webservice on internet. I opened my port which is 4501 an I disabled firewall on modem and on windows. I can write my global ip and I can open modem control inteface. But I want to connect to iis which address is xx.xx.xx.xx:4501/Products.svc
It works on localhost (http://localhost:4501/Product.svc) But I cant connect to svc on internet ..
I dont know where is problem.
When I add my svc link addres as adding reference service I got this error
There was an error downloading 'http://xx.xx.xx.xx:4501/Products.svc'.
Unable to connect to the remote server
Hedef makine etkin olarak reddettiğinden bağlantı kurulamadı xx.xx.xx.xx:4501
Metadata contains a reference that cannot be resolved: 'http://xx.xx.xx.xx:4501/Products.svc'.
There was no endpoint listening at http://xx.xx.xx.xx:4501/Products.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
Hedef makine etkin olarak reddettiğinden bağlantı kurulamadı xx.xx.xx.xx:4501
If the service is defined in the current solution, try building the solution and adding the service reference again.
And One point more,
If I start to IIS, wcf service doesnt work even in localhost. If I start it in Visual Studio (I mean asp.net development service works) it works..
IIS version is 7.5.7600 and I added application pool as Asp.net 4.0
Is there any specific reason you use port 4501 for HTTP in IIS?
Visual Studio 2010 WebDev WebServer (Cassini) uses random port number (4501 in your case) to simplify configuration. It assumes that port 80 can be occupied by its big brother IIS or any other software.
That is fine for development in local machine but there is no need to use the same port in production.
Default HTTP port is 80 and it is usually the most open open port in networks.
Use port 80 for HTTP traffic in IIS and your life will be much easier.
P.S. Did you try http://xx.xx.xx.xx/Products.svc? Port number is part of web service configuration and it is not copied when you move app to IIS. It is possible that IIS already uses default HTTP port.

Debug Windows Phone 7 application that contacts locally hosted WCF server

I've built a WP7 application and a locally hosted (on my machine) WCF server in my solution. I have debugged it using the emulator and it works fine, however, when I debug via device and try to connect to the server I get an exception stating that the EndPointNotFound (I'm aware I haven't set up anything to catch this exception!). Is there anyway to connect to a localhost server via the device?
Many thanks
Jonno
If you are trying to connect to your local machine from an actual device and it si not tethered, make sure that you are connected to the same local network.
What is the host name you are using to try and connect to the host machine? The emualtor will be able to resolve "localhost" to the host mahcien but your phone won't. You'll need to use the appropriate host name or IP address.
Download and install the Visual Studio SP1 tooling and host your WCF services using IIS Express. This webserver accepts incoming connections from other computers on your local network as long as there's a firewall exception to allow the connection.
You'll have to connect to the machine hosting the service through it's external IP. That cannot be localhost or 127.0.0.1 (it has to be something belonging to the same subnet).
Scott Hanselman had a presentation about the "MS Web Stack of Love" where he demos how to set all this up (using HTTPS even) and it goes into depth about how to configure the firewall and all that jazz. I recommend watching it, as he is also, a funny guy.
You can use a Wifi connection on WP7 and the local ip of your server in the config file to reference your WCF server ?

Azure Vmrole WCF services unable to connect

We've been experimenting with an online application hosted in a virtual machine (vmrole) on windows azure.
We are able to connect to the web portal of the application (http) but we are not able to connect to the wcf services using port 5001
We tried with firewalls down
We have enabled the port 5001 in/out
We did a port forwarding check and the port is open for external use.
The 5001 port is clearly listed as an endpoint.
Both the dns name and the ip fail to work, so it is not a dns problem.
On the localhost (using remote desktop) we can connect without a hitch.
On the wireshark sniffing there is no sign of a connection through the 5001 of any sorts.
Any advice on this topic would be appreciated
Tx
Try setting the VM Role project to have an external HTTP endpoint on port 5001. You can do this either in the config files directly or through the project properties in Visual Studio.
Try setting the VM Role project to have an external HTTP endpoint on port 5001. You can do this either in the config files directly or through the project properties in Visual Studio.
Sounds exactly like:
The 5001 port is clearly listed as an endpoint.