WebsitePanel 2 totally NOT working on Windows Server 2012 on Azure - asp.net

I’m having many troubles installing WebSitePanel on an Azure Virtual Machine, with Windows Server 2012.
I followed the steps in http://www.websitepanel.net/documentation/deployment-guide/server-configuration/preparing-windows-server-2008-r2-for-websitepanel-installation/ and installed everything I needed.
Then, I installed the WebSitePanel Standalone Server package with the installer.
I opened the endpoint for the port 9002 on Windows Azure; so I pointed my browser to myhostname.cloudapp.net (note: in Azure you don’t have a static IP address, instead you have an hostname like [hostname].cloudapp.net).
So, loading myhostname.cloudapp.net:9002 fails, and any browser shows something like “Unable to load page”. I think it’s a 400 or a 500 server error.
How come?
IIS works perfectly on the server, in fact the default website runs without problems on port 80.

This issue occurs when you change the binding to another IP address.
Usually I fix this situation by going to the IIS control panel where I change binding back to 127.0.0.1:9002

In case you haven't found the correct solution yet :
edit your hosts file under system32/drivers/etc and put the url you have set up during the installation there with your local ip
You should be able to access websitepanel portal with the url

Related

ASP.NET5 CLR website on Azure Windows Server 2016 running but giving 404 NOT FOUND in browser

I am trying to run a sample ASP.NET5 MVC application on a Windows Server 2016 instance hosted on Azure. All indicators show that the application runs fine on the server, but when i try to browse the URL (using the server's hostname or public IP) i get a 404. NOT FOUND error.
The ports are open in Azure and in the firewall.
The application runs on Microsoft.Net.Http.Server.Weblistener
The runtime is clr-1.0.0-beta5 x64. I have verified that the runtime is properly installed and is being used.
I have published the app from VS2015 and transferred to the server manually, i run it with the command "web.cmd" which is autogenerated, and i get a neat output saying:
info : [Microsoft.Net.Http.Server.WebListener] Start
info : [Microsoft.Net.Http.Server.WebListener] Listening on prefix: http://localhost:80/
Started
When i run the application in exacly the same way on my local developer machine i get exacly the same output, and it works to browse localhost:80 to get to the website.
This, to me, indicates that
The app runs properly
The ports are configured correctly (when i turn off the webserver i get a different error ERR_CONNECTION_TIMED_OUT instead of the 404)
My guess is that there's something wrong with the WebListener server, not properly routing incoming requests to my application, or perhaps something is wrong with my MVC code (although it works fine on localhost).
Sorry for a rather vague question, i am open to all ideas and input, and please feel free to ask further questions so i can provide more information.
Cheers,
Niko
As #Rob and #Amy pointed out, the problem was that the WebListener only had a binding for the http://localhost:80 address. When i tried to browse it using my server hostname, i got the 404 Not Found.
The solution was to change the --server.urls in hosting.ini from http://localhost:80 to my proper hostname. Also found more information on the answer here:
How to Change Server.Urls with Microsoft.AspNet.Server.WebListener (stackoverflow.com)

Request.Url does not allow IPs in ASP.NET MVC

I use Requestl.Url in my ASP.NET MVC application to provide a new page the URL of a returning page. Everything works fine, until I tested my page on an android emulator.
There I used http://10.0.2.2/ to address my local host. But Request.Url gives me "http://localhost/".
That is a problem, since "localhost" points to the real local host of the android phone and "10.0.2.2" to my PC's host.
Why does ASP.NET replaces the IP-address by the localhost name? How can I prevent this?
Thanks, Konrad
If I am understanding your post correctly you are pointing the android emulator to your pc and it is redirecting you to localhost
1st note i should point point out if you are using the Cassini development server built in to visual studio you can't do it like that as it will only accept connections from localhost
As the Android emulator is seen as an external device (even tho it is on your computer) Cassini will not likely accept these connections I'm not sure if that is related to the root cause of your problem or not tho
the other option is to set up a dummy URL for local debugging by adding an entry to your hosts file e.g. myapp.local or asp.localhost.app etc. and pointing it to your PC localhost you will need to likely use IIS Express or IIS full for the purposes of debugging and set it up to accept your host file entry as a binding for the given site you are using
I had to do something similar with a Windows iPhone emulator i was using

Viewing ASP.net Development Server from virtual machine

Microsoft recommends testing older versions of IE with the following virtual machines
This is all fine and good, except that the virtual machines can't see the Dev Server from Visual Studio. This makes it very difficult to develop or debug since I have to copy or deploy to IIS for every little change I make. I've tried using ARR, but it seems it can only forward to one specific port at a time, whereas i need to have the port typed in the address bar of the virtual machine to match the port that it is connecting to on the host machine. Is this possible?
You shouldn't need to deploy to IIS to test changes.
We set our IIS up on development machines to point to the web project folder.
Once IIS is setup, you can add an existing website to your solution, select Local IIS and select the Site from the list of sites (rather than browsing the file system and selecting a .csproj file). You'll now have your site in VS that is hosted by IIS, ready to change and debug, and accessible from remote machines.
Generally speaking you cannot access the ASP.NET Development Server on one machine from another.
Here's some additonal notes on what you cannot do with ASP.NET Development Server from MSDN
ASP.NET Development Server is specifically built to serve, or run, ASP.NET Web pages under the local host scenario (browsing from the same computer as the Web server). In other words, the ASP.NET Development Server will serve pages to browser requests on the local computer. It will not serve pages to another computer. Additionally, it will not serve files that are outside of the application scope. The ASP.NET Development Server provides an efficient way to test pages locally before you publish the pages to a production server running IIS.
The ASP.NET Development Server works only with individual pages and does not include the extra facilities of IIS. For example, the ASP.NET Development Server does not support an SMTP mail server. If your Web application involves sending e-mail messages, you must have access to the IIS SMPT virtual server to test e-mail because the ASP.NET Development Server cannot forward e-mail messages or invoke a server that does.
Anyway.....
Googling around I have found an article where somebody had success on accessing a Development Server remotely using a reverse proxy. I have not tried but here's the link
Configuring a Basic Reverse Proxy in Squid on Windows (Website Accelerator)
Also have a look at this StackOverflow question that has answers describing varous methods to achieve your results
Is There a Way to Make Remote Calls to ASP.NET Development Web Server?
You need to type the development server port into the address bar of the client browser, otherwise host the application in IIS and use the default port.
It is overkill to test with this number of configurations in the development environment. It is generally sufficient to test with 2 or 3 configurations while you are writing code (say IE8, FireFox) - just run these from the local machine (no need for a virtual machine). Once you've finished the UI, deploy your application to a test environment running IIS and test it against the larger range of configurations.
If you test each small change against all of these configurations as the change is made, you'll find yourself overwhelmed with testing. Don't forget that as well as the MS recommended test environments, various configurations of other browsers and operating systems (such as FireFox and Opera, Mac OS) are equally important - you may choose to only test a subset of these configurations depending on your resources.
I too found the link Lorenzo mentions in his comment, but had no luck with Squid configuration.
Happily there's a much easier method, as noted here.
Go to CNET and download SPI Port Forwarder
(Note: Click the "Direct Download Link" below the big green "Download Now" button. If you use the Download Now button CNET tries to install adware on your machine before giving you the file. It's very odd.)
In the first column, "Local Port" put the port you want people to connect to your machine on. I wanted people to come in on 80.
Second column, "Remote host", put "localhost" (it'll apparently port-forward to other machines).
Third column, "Remote port", put the port of the local webserver (in my case the ASP.NET Development Server on port 2485).
Click "Activate"
Hope this helps.
I am answering this old question to help peoples who wants to make it work without IIS. Thank you Fiddler !
1. First Step
You have to download Fiddler.
Once Fiddler is downloaded and installed, open it.
Go in Tools-> Fiddler Option-> Connection tab-> And check "Allow remote computers to connect" :
Restart Fiddler.
2. Second Step
After this, in the VM, open internet explorer-> Internet Options-> Connection Tab-> Lan Settings-> Check "Use a proxy server for your LAN" :
The adress is the IP adress of your DEV machine.
And put the port 8888
Now, you can access the ASP.NET Web Server from your VM !
To access it -> http://localhost.:54814
Don't forget the additional point after "localhost" !
The port, "54814" in my case, is the ASP.NET Web Server port.

Connect remotely to WebDev.WebServer.exe

Developing an ASP.Net website.
Running IE8.
Need to test website under IE6.
MultipleIE6 install broken by IE8 install (can't type in textboxes, yes I deleted cache, yes I re-registered the dll's).
Created VPC running IE6.
Can't connect to host WebDev.WebServer.exe.
Is there any way to configure WebDev.WebServer.exe so that it will accept remote connections?
The workaround for the way that webdev.webserver is crippled to refuse remote requests is to use a lightweight proxy server running on the same host as webdev.webserver. The remote browser then uses the proxy and its requests appear to webdev.webserver like requests originating from localhost. I've used Privoxy succesfully.
Sample config:
Configure Privoxy to listen on an IP
address that is routable from your VM
(eg 192.168.1.1:8118). You can put an IP address on a looback on your host OS and use NAT with the client OS.
Configure your browser(s) in the VM to use
192.168.1.1:8118 for its proxy for all connections including localhost.
Start your app in webdev.webserver
With your VM browser go to the same URL as you would with a browser on your host OS (eg http://localhost:3254)
From the perspective of webdev.webserver the requests will originate from Privoxy on 127.0.0.1 and it will happily serve them up.
UPDATE
These days, I am using Fiddler2 for this. Fiddler has an option in Tools > Options > Connections to "Allow remote computers to connect." But also note that IISExpress can be configured to accept remote connections.
AFAIK, WebDev is coded to specifically reject all external connections... so the short answer would be "no".
Best thing to do would be simply publish the website to your VPC running IIS and test it that way.
I ran into this same issue, and after some research, found that the method detailed at this site worked for me:
http://www.funkymule.com/post/2009/04/17/Making-ASPNET-Development-Server-Listen-for-Remote-Connections.aspx
It involves modifying and reassembling the Webdev server and DLL, but once it's all up and running, I've been able to use older versions of Internet Explorer running in VPC/XP Mode to connect to the WebDev server running on the host machine via the internal network IP (192.168.x.x).
Hmm i am not shure this works, but try adding the WebDev.WebServer.exe to be unblocked from your Windows Firewall.
If this doesn't work you have to install IIS and set a virtual directory directly on your development folder.
I use one of Microsoft's VPC images to test IE6 using the debug webserver, so I don't know what could be causing your issues. Sounds like it could be a networking issue with the virtual machine.
Also IEtester works well for quick checks of rendering and functionality. I have yet to see any major differences between the behavior in IEtester and the real IE6 under XP, but the possibility exists so I still check with the virtual machine before release to production.
http://www.my-debugbar.com/wiki/IETester/HomePage

Can I access ASP.NET Development server in an intranet?

Im testing an ASP.NEt site. When I execute it, it starts the ASP.NET Development Server and opens up a page.
Now I want to test it in the intranet I have.
Can I use this server or I need to configure IIS in this machine?
Do I need to configure something for it to work?
I've changed the localhost to the correct IP and I opened up the firewall.
Thanks
Yes you can! And you don't need IIS
Just use a simple Java TCP tunnel. Download this Java app & just tunnel the traffic back.
http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml
In command prompt, you'd then run the java app like this... Let's assume you want external access on port 80 and your standard debug environment runs on port 1088...
java -jar tunnel.jar 80 localhost 1088
(Also answered here: Accessing asp. net development server external to VM)
No, you can't. It's set up so it only works on localhost, and I couldn't find any workarounds to make it work.
But, here's what I've been doing - I created the website on a specific port in IIS and opened that port up so it's visible on the network. I pointed that IIS website to my website's root folder (the one with web.config in it). Then I continued to use the ASP.NET Development server on that local machine while developing - both IIS and the ASP.NET Development Server can access the files at the same time (unless you're doing something wacky).
Let me know if there's a challenge with running IIS on your machine and I'll update my answer.
I realize this isn't a direct answer to your question, but an alternative to debugging using the ASP development server is to attach to the IIS process: How do I attach the debugger to IIS instead of ASP.NET Development Server?
Nope, stupidly (IMHO) there's no way to get the default ASP.net development server to serve pages to IPs other than localhost. What I did was to use UltiDev Cassini which is very quick to set up and is basically a version of the ASP.net development server compiled by UltiDev, and it will serve pages to any IP address.
Just for those who don't want/cant set up IIS for whatever reason...
Use fiddler or similar on your host - set your browser on the client VM to use the proxy then just use localhost:dev_port as usual on the client.
All requests from the client goto the proxy on your dev machine which routes to localhost on the dev machine and the ASP.net dev server thinks the request is from your dev machine!
You can recompile Cassini to get it to work - there's a fairly easy to remove check for localhost in there. Or, I'm pretty sure Ultidev's Cassini doesn't have this restriction. Both of these are easier to setup than IIS.
But, yeah, the builtin WebDev.WebServer doesn't work....Hmm, unless you run something like AnalogX's Proxy on your dev box and point it to the WebDev port. That should work (though I haven't tried it, it should take < 2 mins to setup).
You can use Cassini to expose your web apps externally. You just need to proxy the connection. I wrote a simple program to do this that you can run in another VS instance. Just change the port to match the port Cassini is using.
https://gist.github.com/945649
You can do port redirection using SOAP Toolkit 3.0
Once installed, go to My Programs > Microsoft Soap Toolkit 3 > Trace Utility
Once Trace Utility opened, go to File > New > Formatted Trace
In the dialog insert your ASP .NET Development Server port in Forward To Destination Port field.
It's only a workaround for testing purposes
I believe the built in ASP.NET server only works on localhost. You'll have to use IIS.
Compile all you website in Debug mode, then create the website and publish it in IIS (make sure you can view it from other machine). Then attach the VS2010 Debugger to the process with the AppPool of your website (the process is called w3wp.exe when IIS>v5 and aspnet_wp.exe when IIS<5).
If you make some changes, just replace the package contents on the physical path of the website, and there you go again.

Resources