Status: offline

maigoofy

Forum User
Junior
Registered: 02/09/03
Posts: 15
I use Mac OS X Server 10.2.5. And I cannot access my Geeklog site in a local directory while I can access it from outside the LAN/router. I get "404 Not Found" message. I tried the following addresses, and it did not work. http://localhost/index.php http://127.0.0.1/index.php http://192.168.0.2/index.php http://mydomainname/index.php However, I have no problem accessing a simple info.php file that shows PHP info when I intall it in the local site directory. What's wrong? I would really appreciate your help.

Status: offline

krove

Forum User
Junior
Registered: 05/06/02
Posts: 30
What do you have in <tt><b>/Library/WebServer/ Documents<b></tt>?

Anonymous

Anonymous
That problem is easy to resolve: Use the hosts file, Luke. ;-)

Ok, I'll get into more detail:

The cause of your problem is this:

a) Your router most likely doesn't support the local loopback feature (most routers don't).

b) Geeklog uses absolute URLs for its resources (graphics, pages, whatever). For example, http://your.url.here/layout/Gameserver/theme-images/gameserver_logo2.gif is the URL to the Logo of the gameserver theme.

What happens is this: Your browser is asked to get several files from a specific URL (see b)), looks up the domain via DNS, gets the IP it has to ask, sends a request for the pages to the specific IP and times out because the router can't send the request back to your computer because of a).

If your router doesn't have loopback you have to access the computers in your local net with their internal IPs, not the global IP.

To make your domain resolve to 127.0.0.1 use the hosts file. I don't know if Macs support a hosts file, but Unix/Linux and Windows does, so I would be surprised if Macs don't use it.

The hosts file is a simple text file with several lines in the format

IP Domain

which has to be in a specific directory and have the name 'hosts' which tells the OS not to resolve specific domains via DNS but to use the given IP.

So simply put the line

127.0.0.1 your.domain.here

into it and you are set. If the server is on a different machine within your local net put its (internal!) IP there of course (which will probably be in the 192.168.*.* range).

If Macs don't support a host file check the web how to manually resolve specific domains to an IP without a DNS lookup. There must be some way.


Status: offline

maigoofy

Forum User
Junior
Registered: 02/09/03
Posts: 15
Thank you for your response. I tried changing hosts file as you suggested. But it did not work. I use Mac OS X Server which seems to look elsewhere for hosts. I will continue to search, but I think I need to learn how to use Net Info. Thank you again for your help. I will post what I find.

Status: offline

maigoofy

Forum User
Junior
Registered: 02/09/03
Posts: 15
happy
No, I was mistaken. Indeed the hosts file solution works for Mac OS X Server 10.2.5. When I saw the instruction in hosts file (/etc/hosts), which says: # Note that this file is consulted when the system is running in single-user # mode. At other times this information is handled by lookupd. By default, # lookupd gets information from NetInfo, so this file will not be consulted # unless you have changed lookupd\'s configuration. I misunderstood it to use NetInfo. Also, when I tried the hosts file solution before, it probably did not work because I did not restart Apache. I just added the following line in Terminal and restarted the server. 192.168.0.2 www.mydomain.com Thank you for your help. It took a long time for me to solve this.