Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can not veiw my webpage using my domain name locally. 2

Status
Not open for further replies.

johnfaniyi

Programmer
May 6, 2003
7
0
0
US
Can someone please help me. The problem that I am having is that I registered a domain name through a DNS, I am hosting the page though. I paid for URL forwarding under my DNS to allow the URL of the page I am hosting to point to the domain name I bought. This is the problem. I have two computers and they both share internet acess through a router, so I have a WAN IP (from my ISP) and two LAN IPs that the router assinged my computers via the router's DHCP server. Anyway, the problem is that when I entering in the domain name from anywhere other than my house, the correct website appears, but when I enter in my domain name and test the domain name locally, it doesn't work, its as if the web page for that domain name doesn't exist but the domain name works everywhere else. I tested the page locally using the URL as opposed to the domain name, and it works properly. When I asked around, I was told that I needed to edit the host file, but when i did that and I tested the page locally using my domain name, instead of seeing the corresponding page, I saw the home page of the web server that I am running (Apache Tomcat). Does anyone know why this is so? Is there a solution that will allow me to be able to view my webpage through my domain name locally.

By the way the computer I am using is running Win ME.

if someone can help me out with this problem I would really appreciate it.

Thanks.
 
It seems like your PC's have not been configured with any DNS adresses.
Contact your ISP ask them what their DNS server(s) IP addresses are and then do one of the following:

1. Either set the DNS addresses manually in the TCP/IP setting of each PC.

2. Put the DNS adress(es) into the router setup so that it send these to the pcs as part of the DCHP message.

 
Just use the local LAN-side IP and port when on the LAN. Your router does not do reverse forwards when the source WAN IP and destination WAN IP are the same.

 
I agree with bcastner (most SOHO routers will not do an internal loopback on it's own WAN address) but (!) - it sounds like apache is running virtual server - if you only connect using the IP (&port), it'll connect to apache's default screen - you need to connect using the URL.

In which case - add the following to the "hosts." file:
192.168.0.2 yourdomainname.com
(where 192.168.0.2 is your apache server's LAN address)

<marc> i wonder what will happen if i press this...[pc][ul][li]please give feedback on what works / what doesn't[/li][li]need some help? how to get a better answer: faq581-3339[/li][/ul]
 
I would like to thank you guestgulkan, bcastner and manarth for giving your inputs, I appreciate it. I did exactly what manarth said (I stated this in the thread) but this is what happens:

you said I should edit my host file as follows,

192.168.0.2 yourdomainname.com
(where 192.168.0.2 is my apache server's LAN address)

When I did this, the home page for apache tomcat appears when I type in the domain name. I also tried editing my host file as follows,

192.168.0.2/web/index.htm yourdomainname.com
(where 192.168.0.2/web/index.htm was the LAN URL for the domain name ) This did not work also, it say page cannot be found.

This problem is driving me crazy because its like I can access the webpage using the domain name anywhere but internally. And when I type in the URL locally it works also, it just testing the domain locally that is not working.

Please do you guys have any other suggestions ?????????
 
If you are using a virtual server in apache, then you need to send the command 'Host: but if you only use the yourdomainname.com, apache doesn't know that it is the same virtual host.

You need to add ' to your host file, and then use that URL. It should be fine then. You can add yourdomainname.com to your virtual hosts in apache and it should point you correctly.

I see that you are running Windows, and this is from my Linux server running virtual domains, so it may well be different, but there should be a functional equivalent of this file in Windows.

Take a look at this in /etc/httpd/conf/httpd.conf:

<VirtualHost 192.168.1.1>
DocumentRoot /var/ServerName ServerAlias yourdomainname yourdomainname.com UseCanonicalName off
</VirtualHost>

You could also attempt to telnet to the server and issue the following commands:

GET / HTTP/1.1
Host:
Make sure that you have two consecutive carriage return/line feeds (enter keys) at the end, and it should dump your web site's index.htm(l) or default.htm. If you don't send the Host command, it should send the Apache Tomcat page.


pansophic
 
Thanks pansophic for your input. I really appreciate you guys help. Pansophic, everything you said makes sence, but there is only one little problem; I am running Tomcat which is a servlet engine. Its still made by apache, but its a servlet engine and is different from the apache http server you were reffering to. Tomcat doesn't have the /etc/httpd/conf/httpd.conf file that apache http server has. Tomcat has its own configuration folder called the &quot;conf&quot; folder and there is a server.xml file that I think may be the equvalent of apache's httpd.conf file. I am not sure though, also, I don't see a section in the server.xml file that would apply to defining a virtual host. So I guess:

The struggle continues ............. :( but thanks for your help though.

Do you have any other suggestions........ :)
 
do you by any chance use a proxy server? i had the same prob when i used a proxy. you have to check the &quot;bypass proxy sever for local adresses&quot; in Internet Options, Connections tab, Lan Settings. its prob not that since you have registered your website in dns and all, but still you might wanna try.
 
Thats not the solution !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


?????????????????????????????????
:(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top