Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have setup:

<VirtualHost 127.0.0.1:9900>
  ServerAdmin webmaster@localhost
  DocumentRoot "c:/wamp/www"
  ServerName url.pews.info
  ErrorLog "logs/localhost-error.log"
  CustomLog "logs/localhost-access.log" common
  DirectoryIndex gauge.php
</VirtualHost>

When I try and access url.pews.info from the browser on the server computer, all works well.

However, I tried typing url.pews.info into the browser of my iPhone, and it could not connect, allthough it is connected to the same WLAN as the server is.

Why is that?

Thank you for your time.

Kind regards,
Marius

share|improve this question
add comment

2 Answers

Your virtual host is bound to 127.0.0.1:9900. That makes it bind to loopback interface and not listen to connections from outside world. This at least in Unix/Linux environment, I would think the same applies in Windows as well.

Make that address *:9900 or your.ip.address.here:9900 instead and restart Apache. That should make it work.

share|improve this answer
add comment

You probably don't have any DNS setup on the network to allow your other devices to resolve the hostname (url.pews.info) to an IP address.

I suspect this works on the server locally because it's hostname is the same as the URL you are trying to access, so it is able to resolve it while other devices can't.

Depending on your network setup and whether this is for internal or external use you may be able to add DNS entries on your local router, domain controller, other DNS server or even the external DNS of the people hosting your domain, though the last one may throw up some additional issues.

Alternatively you could add a ServerAlias directive to your Apache configuration and access via IP:


ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName url.pews.info
ServerAlias 192.168.0.1
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
DirectoryIndex gauge.php

Then clients could connect to the IP of the web server and get the page.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.