0

from default httpd.conf to updating the host file and httpd.conf i tried but the website fails to open with domain name give

in host file

<my current public ip address>  <domain name>

in httpd.conf

Listen [my public ip]:port

then restart of wamp server and finally restart of PC and of-course change of ip is done in above all. But of no use Please help Thanks for time and response

  • Sorry, I didn't get your concern completely. Are you having issues in viewing website on local machine after adding the entry to the "hosts" file.. does the website works fine from the public hosting server... – Leo Prince Jan 20 '15 at 10:00

1 Answers1

0

Aaron,

I think you are misunderstanding the function of the HOSTS file.

The hosts file acts a little like a local DNS Server. Any changes you make to it will only effect the single PC that you made the change on.

What the HOST file actually does

When windows starts it starts a service called DNS Client also known as dnscache. That service reads the HOSTS file and seeds the dnscache with any domain names you put in it and the ip that should be connected to for each domain name.

Any program (the browser in this case) that wants to connect to a domain, checks this cache first, to reduce accesses to an actual DNS Server out on the web and therefore speed up the conversion of domain name to Ip Address.

So if you want external users, i.e. anybody on the internet to be able to access your site you have to either purchase a real domain name and get it pointed to your WAN ip address, or use a Dynamic DNS service like DYNDNS or NO-IP, to mention only a few, and get that dynamic dns service to point to your WAN IP.

You will also have to change your Apache config so it will serve that domain name, my suggestion would be to create a Virtual Host to do this.

This post may help with the process of creating a Virtual Host

Community
  • 1
  • 1
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149