Allow others to access the website created by ASP. net mvc on your computer, asp. netmvc
I recently wrote a website and just finished it yesterday. I wanted to deploy it on my computer because I wanted to test it with my friend but he had no environment on his computer, let him access the test through a browser, so from last night to this morning, he finally got it done through various searches.
First, I will introduce the environment I used. The website is written using the ASP. NET MVC4.0 platform version. NET Framework 4.0 operating system window7.
- 1. Enter the control layout in sequence-program and function-open or close the window function and then, as shown inInternet Information ServiceSelect
- 2. Go to control panel-Administrative Tools-Internet Information Service (IIS) Manager
Note that the default. NET Framework version is 2.0 on the right. We will change it to 4.0.
Click ASP under IIS
Set the Enable parent path to true.
- 3. Now we can create a website.
You can set the website name as needed,Application poolIt is very important that I select an existing one here. You can also create one by yourself. Set the IP address to the IP address of your computer. Then confirm.
The version of the application pool is very important. The default version of the application is 2.0, which must be changed to 4.0. Otherwise, when you visit the website, yes, this statement in the configuration file reports an error.
If you are using the 4.0 framework, set the version of the application pool you are using to V4.0.
There are also 1.1 to view
Version 4.0 is not banned.
Note thatIf we have installed 4.0, but we cannot find the 4.0 option in the above-mentioned scenariosAfter installing IIS, run the command line as the administrator and enter C: \ WINDOWS \ Microsoft. NET \ Framework \ v4.0.30319 \ aspnet_regiis.exe-I.
Now, Click Browse on the right side of the page, and an error is returned. Solution: Set the c/windows/temp attribute security and set the readable and writable permissions for IIS users so that the website can be accessed smoothly.
However, you still cannot access the Internet. If you are connected to a vro, you can access the lan. We need to set a forwarding rule for the internet. Each vro has different settings. Mine is a polar route, the settings are as follows:
This rule means that when someone accesses your Internet IP address, you can transfer it to the corresponding IP address in the LAN. Note that the Internet IP address is the same as the WAN port IP address. If the IP address is different, you may have connected multiple routers. My reason is that China Telecom's broadband network is not a bridge mode, and the cat is equivalent to a router. So I called China Telecom and asked him to change it to a bridge mode. Generally, the dial-up mode is a bridge mode, then it is done. I still have a sense of accomplishment.
My ip address is
Access Port 4040.
Is it easy.