how to run web application in another machine? - asp.net

I want to run my web application in another machine.My problem is that i have already created virtual directory in iis 7.5 and add web application in it. Its running in my machine properly but i am trying it run in another machine through url and add the ip address along port number but its not found the web page.Plz help me .

What you need to do is go to the machine on which you want to run your web application, then set up a virtual directory on that machine. Make sure port 80 (or whatever port you decided to run your web application on) is open on the firewall (probably Windows firewall) too. Then you can access your web app on the other machine with a url like http://hostname, where hostname is the NetBIOS name or IP address of the machine you want to access.
If you get a timeout, then IIS isn't running or the firewall is closed. If you get a 404 error, then your virtual directory isn't set up correctly or you typed an invalid URL.

Related

How to access ASP.NET app from another pc on the same network?

I'm running a ASP.NET on my pc and I would like to access to that app from another pc on the same network. I've tried to reach the app writing the URI of my pc on the network followed by the port number as below:
"192.168.X.X:49223/"
But it shows me an 400 error saying that it's an invalid hostname...
Is there something to do with my windows firewall or in IIS to allow access from another PC ?
Thanks for your help.
You may need to an exception in Windows Firewall.
Control Panel > Windows Firewall > Advanced Settings > Inbound/Outbound rules.
Add a new rule to both, specifying your port number and a generic name to identify its purpose.
Install IIS server on your machine, then deploy your application on that IIS server.
Refer this for Deployment assistance
To run the application on IIS instead of ASP.Net dev server you need to
Right click on solution in VS
Click on Start Options..
In Server section, Select "Use Custom Server" and then provide the URL of the application you have added earlier on IIS
Then you can easily access your website from any other machine on the same network.
Is it hosted in iis, or are you running it through Visual Studio. The funny port number (49223) tells me it's the latter.
When you run a VS project, the dev server is designd to only allow local conconnections. If you connect from a network it gets blocked by design. Their is no config around it.
What I do as a hack is run a reverse proxy like Nginx. It's a free download. Run it on your dev machine. You can tell it to listen on a port (eg 88) and then redirect tge traffic to port 49223. Give your mate the same url as before but replace the port with 88
Nb make sure your port 88 is open as per codemans answer
An example of the nginx config would be https://gist.github.com/ekinertac/5524389
This then tricks VS into thinking it came from your local machine.

IIS7 - Using an ip address and port number will not display a web site home page but using localhost will

Using ASP.Net I did a web site and can load it up in a browser window when pressing the F5 key in VS2010.
On the browser window I noticed VS2010 used an address like this to load the web site home page:
localhost:12345/
If I try to use the ip address for my computer found by using ipconfig to load up the home page,
1.2.3.4:12345
I get an error stating:
Could not connect to 1.2.3.4:12345
If I use:
1.2.3.4
I get the IIS7 default page.
The actual address and port numbers I used in this example are different than those I really used.
Can you tell me why localhost works but 1.2.3.4 does not work?
Can you tell me if I need to do something extra with IIS7 since I never did this before?
A couple of things to remeber. Your computer two types of IP address. The first is a private IP address and the second is a public IP adress. IPConfig will show you your local, private address. Your private address will not be accessible from anywhere outside your LAN.
If you would like to change your websites URL locally from localhost, you need to change your IDE's development settings.
This site has a great tutorial on how to do that.
First things first, the address Visual Studio gives you is a temporal address that corresponds to their development server (Webdev.Webhost or Cassini), this server doesn't allow you to connect outside your computer, that's why localhost:1234 opens your page, but 5.6.7.8:1234 doesn't.
Second, also you seem to have IIS configured, but what you need to do is deploy your site to IIS, here are Microsoft information about deploying your site: http://msdn.microsoft.com/en-us/library/20yh9f1b(v=vs.100).aspx, once deployed, you may create an Application on IIS or a Virtual Directory, for more information you can take a look here: http://technet.microsoft.com/en-us/library/cc772042(v=ws.10).aspx.
Once you have deployed and configured your application or virtual directory, you can access your site like this: localhost/MyVirtualDirectory (assuming you set a virtual directory).

Asp.net Application Accessible to other machines

I have application..its runnning on my localhost.. i need one more machine to access that application.. but when in tht link i type my IP address instead of localhost.. it showing cannot find server.. can you plz tell me steps what i need to do in orderr to access appplication to other machine.. as such there is no UAT server as of now...
First off, make sure your firewall allows access through port 80.
Then, check if your IIS allows access from outside IP's.
I can help more if you provide this:
Your OS (XP, Windows 7, etc)
the local link to your app. Is there a port number needed to access the app?
LaterEdit: Ok, then you need to do this:
Now, your app will be served by IIS on port 80 (default). Check your firewall to allow traffic through this port.
If you IIS is set for another port, then use that one.
Checking the port in IIS:
I'm going to assume that you are running the application from Visual studio which allows the localhost to run.
In order for your application to be available to other machines on the network, you have to ensure that IIS is installed on your development machine and then a website is set up for that application as well.
The application existing in IIS is what will make it accessible across your network.

Cannot access web application (Internet Explorer Can Not find this Page) remotely

I have Deployed my Asp.net web application on IIS 7.0 on localMachine(Server) and it is working fine there.
But when i try to access it from other machine in LAN, It gives me error that, 'Internet Explorer Can Not find this Page.'
I am accessing it on terminals using server name address and also tried using IP address.
Even I have Shared the Application Folder in network.
Check the Windows Firewall on your Vista PC. You need to let TCP port 80 through.
Make sure that you enable the firewall and bind to IP addresses other than localhost.
You don't need to and should not share the application folder.
This is a security risk as people on the network will be able to access the source code of the application. Also, it won't help with the problems you're having because a network share is not accessed over HTTP and so will never hit IIS and your web application. So you can turn off sharing for the folder and be safe in the knowledge that this isn't the issue.
Next, check your windows firewall and make sure incomming web trafic is allowed ("http" or "port 80").
Next I would have a look at the host headers that the site is running on.
Then maybe update your question with more detail.
Greg
You may also want to ensure that IIS is listening on the correct IP Address. This problem can occur if you switch from a LAN connection to a wireless connection (for example when taking a work laptop home).
To Check this, open inetmgr and right-click on the 'Default Web Site' node. Verify that the IP Address entry is set to the current IP of your machine.

Getting site running in IIS 7 Issues

This is driving me nuts. I am trying to setup a webiste on our dev server with a specific url name www.mystpidsite.com as an example. mystupidsite is not the same name as the dev server.
1) specify a specific url to use for the website I create in IIS
2) run it and use that url to access it
I have:
1) created a new site in IIS 7 in Server 2008
2) attempted to access it via the site name which I set to the desired url and port 8888. So if we want it to be www.mystupidsite.com I setup the website name to mystupidsite in IIS 7.
3) I even tried to create an application under mystupidsite with the same name in IIS 7.
The server is definitely accessible and pingable on the network from my local PC, we have other stuff installed on this new server. Do I need to create an application or is just creating the website enough in IIS 7? I specified the IP as the server's IP in the website I made.
For the host name in the bindings of the site I put www.mystupidsite.com
when I try to access the site via www.mystupidsite.com it can't find it and the site in IIS7 on the dev server is running. It's running on a HyperV instance which is our dev server. Everything else has worked just fine. I just wnat to understand how to get a specific url by name setup.
Do I need to add something in the hosts file on the server or something?
You're not going to be able to have a site on your dev box answer to both the mystpidsite.com and mystupidsite.com domain names.
Unless you have the domains registered and have your domain's nameserver directing that name to your dev machine, IIS is only going to answer to requests either the machine name on the network or the IP address of your machine (in addition to 127.0.0.1 and localhost).
The only thing you're going to be able to do outside that scenario is set up two sites on two different ports on your machine and access them from http://localhost:80 and http://localhost:8888 (or network computer name equivalent).
you need to have an entry in dns to be able to hit the server when using www.mystupidsite.com
Because you have the site running on an alternate port you should be able to get to it by http://your-server-IP-address:8888
If you want to test it locally using the host name and do not have access to dns you can add the appropriate entries to the hosts file on your local machine (c:\windows\system 32\drivers\etc\hosts)
What happens when you type 'nslookup www.mystupidsite.com'? Do you get the IP address of the virtual server?
Do you have the windows firewall enabled on the server? if so, did you add an exception for port 8888?
add a default binding (no host header / blank) and try accessing it by IP

Resources