Hostname issue on iPhone

39 views
Skip to first unread message

Cranbo

unread,
Feb 25, 2012, 9:52:39 PM2/25/12
to domuslink-users
When I try to use domus.Link from my iPhone, I have to use my server's
IP address (because the iPhone doesn't allow you to edit the hosts
file, and because I don't have anything else providing local DNS) ...
so I can access the main page via "http://192.168.1.201/domus.Link"
just fine, but as soon as I try to do anything else, the server tries
to go to, for example "http://newport/domus.Link/index.php?
page=Other", which is to say, it replaces the IP address with the
server-provided server *name*. Which then fails, because my iPhone
doesn't know what "newport" is.

Suggestions? This could be more an Apache issue, or a PHP issue, I'm
not sure.

Thanks for any ideas,
</rob>

Brad

unread,
Feb 25, 2012, 11:06:12 PM2/25/12
to domusli...@googlegroups.com
So, does your server have a host name of newport? Also, does your apache config file specify the use of the host name? Looks like the return address from apache is being given as newport. You'll need to read up on your Apache config with your installation.

Brad

Cranbo

unread,
Feb 26, 2012, 6:39:30 PM2/26/12
to domuslink-users
On Feb 25, 8:06 pm, Brad <crush...@yahoo.com> wrote:
> So, does your server have a host name of newport? Also, does your apache
> config file specify the use of the host name?

Yes, the server's name is "newport". I tried changing the "virtual
host" file to start like this (using the IP address instead of "*",
not that I expected it to help):

NameVirtualHost 192.168.1.201:80
<VirtualHost 192.168.1.201:80>
<IfModule mod_alias.c>
...

but that didn't change anything. Any clicked URL still goes to the
hostname, not the IP address.

In regular HTML, I think there's something about setting a "base", but
I don't know if that pertains.

I'll bet you can reproduce the issue if you use your server's IP
address instead of name. Go to your main domus.Link page using the IP
address, and click on any link - I bet you see the URL change to use
the hostname.

Brad

unread,
Feb 26, 2012, 9:06:24 PM2/26/12
to domusli...@googlegroups.com
I know on my test machine, I had to fiddle with the /etc/hosts file to get the name to be the ip of the machine and not localhost. Some default setups put the name you give the machine as an alternate of localhost instead of the given ip for the interface.

Brad

ed209

unread,
Feb 28, 2012, 9:26:39 AM2/28/12
to domuslink-users
Use zeroconf multicast DNS (mDNS). Let's say your host is called
vader.

On Mac OS X.... do nothing, Bonjour is already running
On Windows.... install Bonjour for Windows from Apple (easiest thing
is just to install iTunes and you get it anyway)
On Linux... install Avahi which comes preinstalled in most consumer
distributions these days, for example uBuntu and RedHat.

Then, any iOS device or other device running mDNS will be able to see
your host as:
http://vader.local
This does not require a dedicated DNS server.
Google zeroconf or apple bonjour for more information.

Cranbo

unread,
Feb 29, 2012, 7:02:49 PM2/29/12
to domuslink-users

On Feb 28, 6:26 am, ed209 <marc.p.bai...@gmail.com> wrote:

> Use zeroconf multicast DNS (mDNS)
...
>
> Then, any iOS device or other device running mDNS will be able to see your host as:http://vader.local

That's pretty cool. I already have Bonjour (since I have iTunes on my
Windows desktop) so I was pretty excited to read your suggestion. So I
tried it out.

http://newport.local/domus.Link gets me the main page. Cool! Click on
any link, say "Home", and I get "Safari canning access the page
because the server cannot be found", because, as before, domus and/or
PHP and/or Apache creates a redirect to http://newport/domus.Link/index.php?page=domus_home_page,
not http://newport.local/domus.Link/index.php?page=domus_home_page

But thanks for the suggestion!

</rob>

Marc Bailey

unread,
Feb 29, 2012, 9:42:55 PM2/29/12
to domusli...@googlegroups.com
Definitely agree this is now either an Apache or PHP config problem. It can't be the code since this is exactly how I host domus.link.
It means you have a hostname or virtual host config explicitly set to "newport" somewhere - it should either not be set (best - hostname should not be explicit) or set to "newport.local". You chould check that you are either not using virtual hosts in httpd.conf or that you're using name based virtual hosting.
Reply all
Reply to author
Forward
0 new messages