Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Archive

macrumors member
Original poster
Aug 23, 2007
57
0
Hi,

I have my webserver activated in the system preferences and everything worked fine. My friends on the net could access my page by just typing http://IP/~username.

But suddenly, that adress bar gets replaced with my local host name or network ID. Even over the internet! Which of course leads to them not being able to connect, since I am not on their network.

Any help is greatly appreciated, especially since this technicality is difficult to research on google.
 
Hi,

I have my webserver activated in the system preferences and everything worked fine. My friends on the net could access my page by just typing http://IP/~username.

But suddenly, that adress bar gets replaced with my local host name or network ID. Even over the internet! Which of course leads to them not being able to connect, since I am not on their network.

Any help is greatly appreciated, especially since this technicality is difficult to research on google.

Do you have a permanent IP address from your ISP? Does your router use NAT? Have you set Apache up to use the permanent IP address (if have one)?

Edit : Oh and what IP address is it that your friends are using to access your machine? If it starts 192.168 it won't work.
 
Are you saying that a person who is not on your local network points to your computer using the ip-address/~yourusername format, and then automatically gets redirected to local-name/~yourusername?

Were the computers previously on your local network?

Have you tried emptying their browser history and re-trying?

Have you made sure that, if you are not using DynamicDNS and/or don't have a static IP address, that your ISP has not dynamically assigned you a new IP address upon lease renewal?
 
It may be how the links are setup. If you have the status bar shown in your browser, check to see what it says. It also may be something you can remedy in the Apache configuration (httpd.conf), but would need more details of what is going on.
 
Hi,

I have my webserver activated in the system preferences and everything worked fine. My friends on the net could access my page by just typing http://IP/~username.

But suddenly, that adress bar gets replaced with my local host name or network ID. Even over the internet! Which of course leads to them not being able to connect, since I am not on their network.

Any help is greatly appreciated, especially since this technicality is difficult to research on google.

I've noticed that too and it's very annoying! Not sure what causes it, but I have found a workaround that seems to work (at least on my setup): If you use the full URL (including the page name) the machine address doesn't get re-written and things seems to work from there on. So, if your start page is index.php, putting http://IP/~username/index.php in as the address should work. Good luck!
 
Are you saying that a person who is not on your local network points to your computer using the ip-address/~yourusername format, and then automatically gets redirected to local-name/~yourusername?

Were the computers previously on your local network?

Have you tried emptying their browser history and re-trying?

Have you made sure that, if you are not using DynamicDNS and/or don't have a static IP address, that your ISP has not dynamically assigned you a new IP address upon lease renewal?

You have understood the problem correctly. The computers were never previously on my local network. I have dynamic IP addresses from my ISP, but I use dynamic DNS and can always check my current IP.

For instance when I try website analysis tools (uitest.com) and I give in either my Internet IP or my DynamicDNS name I get an error and it displays my local Network name. This is VERY irritating since anybody who knows my Internet IP can now check my Network Name without being on my Network.

The workaround from Phil A. works. Thanks man!

But this is truly disturbing....I have just used a number of website checks at uitest.com and if I don't use this workaround those websites really CAN spy my Network name....is that a security risk, or are they supposed to be able to do that?
 
I had the same exact problem until another user on here helped me out.

Here is how to fix it:

Open up Terminal and use the command cd /etc/httpd to navigate to that directory. Now use the command sudo nano httpd.conf to open the configuration file for editing in root mode. It will ask you for your password.

Once you have the file open, you're going to want to panic. Don't. Press Control-w, and then type UseCanonicalName and press Enter. The cursor should jump to the spot in the file where that directive is. Use the arrow keys and the delete key to get rid of "On" and replace it with "Off". Now press Control-o followed by Enter to write (save) the file, then Control-x to exit the nano editor.

Now, still in the terminal, run sudo apachectl restart. That should restart the Apache web server. Let me know what happens, or if you get stuck.
 
I had the same exact problem until another user on here helped me out.

Here is how to fix it:

Open up Terminal and use the command cd /etc/httpd to navigate to that directory. Now use the command sudo nano httpd.conf to open the configuration file for editing in root mode. It will ask you for your password.

Once you have the file open, you're going to want to panic. Don't. Press Control-w, and then type UseCanonicalName and press Enter. The cursor should jump to the spot in the file where that directive is. Use the arrow keys and the delete key to get rid of "On" and replace it with "Off". Now press Control-o followed by Enter to write (save) the file, then Control-x to exit the nano editor.

Now, still in the terminal, run sudo apachectl restart. That should restart the Apache web server. Let me know what happens, or if you get stuck.

That did it!

Thank you very much!
 
No problem.

Glad I could help you with something that was very frustrating for myself! :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.