Wednesday, 29 July 2020

View hosted site on other machines in Same Network

Create a website in IIS

 
Open run (windows key + R) and type inetmgr and press enter
 
image1
 
image2
 
IIS Manager opens.
 
Then right click on Sites and click on Add Website. The Add website dialog opens.
 
image3
  • Fill in required details and select folder where compiled code is located. Eg: C:\Nigel\Publish
  • Select required port , default is 80. I will be using 7500.
  • Do not enter host name details if you are testing or using on LAN. 
Then click ok. A website gets created and it will show under Sites.
 
image4
 
Now right click on website name then Manage website and then click browse.
 
image5
 
The link should be in the form on http://localhost:7500/  if you used port 7500 and selected http.
 

Locate your IP Address

 
Now open command prompt. Type cmd in run.
 
image6
 
Type ipconfig and press enter. Now locate your PC's IP address on the LAN.
 
image7
 
Now in your website link replace localhost with 192.168.0.24 (IP address) so your URL will be - http://192.168.0.24:7500/
Try it in your browser to make sure it works.
 

Change Firewall Rules

 
In Cortana search type firewall then click on Windows firewall with advanced security.
 
image8 
 
The firewall window opens.
 
image9
  
Click on Inbound rules on the left. Then click new Rule in the right side menu.
  
image10
 
The New inbound rule wizard will open. What type of rule would you like to create? Select Port and click Next.
 
image11
 
In Does this rule apply to TCP or UDP? Select TCP. Then enter port number (7500) in specific local ports textbox. Then click Next >.
 
image12
 
Then the Action form opens. Select Allow the connection and click Next .
 
image13
 
Then the profile form opens. In the When does this rule apply? - Select required ones , if not sure then select all. Click Next.
 
image14
  
Give this Firewall rule a Name and Description, so you know for what purpose you created this. Then click finish.
 
image15
 
Now if you share the link we created earlier with someone else on your LAN it should open your website.
 
Link example: http://192.168.0.24:7500/

No comments: