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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

http://localhost/ Error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Ok, so the 'test page' loads when localhost or 127.0.0.1 is ping'ed, but when I type in the Server Name, it doesn't work. What's the deal, friends?

DGK

p.s. - running Apache1.3.22 for Win32 platform(s), connected through Linksys router with Cable service
 
Hi,















Not certain what you mean here by server name. Anyway there are basically two issues :















(i) Ignoring the http:// bit, the part of the address up to the first / must be resolved to a numeric IP address before the system can route anything. It's the same for localhost as for any other 'canonical' name. So, you have to have those names translated somewhere, either with DNS or with the HOSTS file, i.e. c:\WINNT\SYSTEM32\DRIVERS\ETC\HOSTS. You would have lines in there like :















127.0.0.1 localhost







172.16.16.1 ntserver1















.. or whatever. M$ name resolution is a bit more complex because it can also use WINS or LMHOSTS if other methods fail, i.e. where it assumes that the TCP/IP Hostname is the same as the Netbiosname of the BOX (which it may or may not be).















(ii) There must be a known route (or default gateway) to enable routing of the packets to the resolved IP address. If you are saying you can only connect after pinging an address thats a bit odd but could be possible, e.g. in a switched environment. On M$, the ping command uses ICMP packets and if it reaches the address the sender will store the associated destination MAC address in the ARP table. If a MAC address for a given IP address is already in the ARP table when routing is needed, then the ARP resolution part is not necessary and packets can be 'addressed' directly at the machine concerned. If you do :















arp -a







ping netserver







arp -a















.. you will see what happens. (I think thats the M$ syntax for arp)















Hope this helps























 
When I speak of Server Name, I am referring to the 'ServerName' derivative in the httpd.conf file.

Did an 'arp -a' and had an output of:

Interface: 192.168.x.x -- 0x2
Interface address Physical Address Type
192.168.x.x xx-xx-xx-xx-xx-xx dynamic

Also ping'ed the host and it displayed the output accordingly.

The .../etc/hosts file only includes 127.0.0.1. That's not right, is it?


Thanks in advance
- DGK
 
alright, so i added the interface ip and the servername to the /etc/hosts table...and voila, i can hit the page......but you guys can't hit the page!(had someone check)
 
Hi,

Actually, ignoring virtual hosts, the ServerName directive would normally be set to the hostname plus domain name, e.g.

ServerName redhat.mydomain.com

(where redhat was the name given to the host running the server)

or more likely...

ServerName
That directive is used by Apache to internally construct self-referential URLs - for example for redirection URLs. It would need to be capable of name resolution, however, so can't be any old meaningless name and it wouldn't make a lot of sense to set it to unless that was who you were. If you don't set it at all then Apache will try to find a TPC/IP hostname for the machine it is running on and use that

Hope this clarifies
 
ok ok ok ok....I think I got it...

am I supposed to edit the /etc/dfs/dfstab ???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top