Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use mod_proxy to test a website I am building on a local virtual machine from my phone. My network looks like this:

IP 1:
IP 2:
OSX 10.8.2 / Apache 2.2.22
Parallels 8.0

VM guest:
Win7 / IIS 7.5

Configured to use as a proxy
iPhone iOS 6.0.1

I've inserted the following into http.conf:

ProxyRequests On
ProxyVia On

<Proxy *>
    Order deny,allow
    Deny from all
    Allow from 10.0.0

<VirtualHost *:80>
    ServerName example.local 
    ServerAlias *.example.local
    ProxyRemote http://example.local/*
    ErrorLog "/private/var/log/apache2/example-error_log"
    CustomLog "/private/var/log/apache2/example-access_log" common

My /etc/hosts (on host OSX machine) currently doesn't reference example.local. Previously I have had a reference in /etc/hosts (on host OSX machine) and was able to view the site on the IIS guest from the host without any issue. Hence I believe the IIS guest is correctly configured to accept HTTP requests.

I am able to view a site hosted on Apache from my phone and am able to visit the BBC's site. Without the proxy configured on my phone I am unable to view the website hosted on Apache, but am able to view the BBC's website. Hence, I believe the phone is correctly configured.

This leaves configuring Apache. I've tested the config with apachectl -t and no errors are reported. I am unable to see any errors reported in the log files /var/log/example-error_log, /var/log/example-access_log, /var/log/error_log and /var/log/access_log.

I would be very grateful if anyone could point me in the right direction.

Many thanks, Chris

share|improve this question

For reference, this is how I resolved this:

1) Set up a DNS server on the LAN which is an authoritative name server for example.local. Both host and phone are configured to use this as their DNS server.

2) Configure host running Apache which already had mod_proxy and mod_proxy* loaded by adding the following to the end of /etc/apache2/extra/httpd-vhosts.conf.

<VirtualHost *:80>
  ProxyPreserveHost On
  ProxyPass / retry=1 acquire=3000 timeout=600 Keepalive=On
  ProxyPassReverse /
  ServerName example.local
  ErrorLog "/private/var/log/apache2/example.local-error_log"
  CustomLog "/private/var/log/apache2/example.local-access_log" common

The host now acts as a reverse proxy for any machine on the LAN that uses the specially configured DNS server.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.