At home I have a simple network setup containing 2 machines.
On one machine i have a site hosted with IIS7. Rather than the standard localhost/index.htm
address I have added an entry in the HOSTS
file pointing the local IP (127.0.0.1) to this domain - www.mysite.dev
.
I can access the site with www.mysite.dev
with no problem.
what I would like to do is be able to view this site from my other machine on the network.
Initially I assumed this could be done with a URL like so
MACHINE-NAME/www.mysite.dev
, but the connection always times out. But I can ping MACHINE-NAME
without problems.
For testing purposes I have disabled the windows firewall on both machines but to no joy.
Like a typical web developer, my hardware/network skills are pretty poor.
Can anyone see where I'm going wrong?
First of all, try to connect to the LAN IP of your server. If IIS is set up with only one web site, chances are that your site is going to pop up.
If you want to access it by name, you would have to add an entry in the HOSTS file of every client PC you want to view the site with (not to 127.0.0.1 obviously, but to the local IP address of your server).
Also, your Firewall needs to be configured to accept incoming calls on Port 80.
This is usually the point where it makes more sense to set up a DNS service that you can register names like "mysite.dev" with centrally, without having to dabble with hosts files. But that's a different story, and belongs to superuser.com or serverfault.com.
Very Late Answer but I will highlight some point as I had to deal with it years ago setting up my IIS site across network
168.192.x.x
or viahttp://his-pc-name
(do not forget the http part)Make sure your IIS is working fine on remote machine by checking
localhost
which should served the default site. Also make sure your firewall is configured to allow connection via port 80 or you can just disable firewall for the time being for testing purposes.Open firewall settings. Then search for something like - Allow program or feature to allow through firewall. If in the list World Wide Web services (HTTP) is unchecked, check it and restart the system.
Our machine is all set to accept inbound requests.
After installing antivirus I faced this issue and I noticed that my firewall automatically set as on, Now I just set firewall off and it solved my issue. Hope it will help someone :)
If you're hosting website on a specific port in IIS like 4321 then you'd have to allow this port through Windows Firewall too. Here're the steps that I followed along with the imanabidi's answer to get it work for me:
You have to do following steps.
Go to IIS ->
Sites->
Click on Your Web site ->
In Action Click on Edit Permissions ->
Security ->
Click on ADD ->
Advanced ->
Find Now ->
Add all the users in it ->
and grant all permissions to other users ->
click on Ok.
If you do above things properly you can access your web site by using your domain.
Suggestion - Do not add host name to your site it creates problem sometime. So please host your web site using your machines ip address.