Use SquidMan to access vhosts on Mac - mhulse/mhulse.github.io GitHub Wiki
Use SquidMan to allow your mobile device to preview your vhost
s over the LAN.
Important: Do NOT use .local
as your spoof tld
as iOS(8) does not like this (for reasons unknown). I choose to use .proxy
to make spoofed domains easy to remember (e.g., http://git.proxy).
I use Hosts for the spoof.
Spoof example:
Note: Don't forget to click the lock icon or close the window, otherwise the spoof may not take effect.
Example vhost
:
<VirtualHost *:80>
DocumentRoot "/Users/mhulse/github"
ServerName git.proxy
ServerAlias www.git.proxy
ErrorLog "logs/git.proxy-error.log"
CustomLog "logs/git.proxy-access.log" combined
#DirectoryIndex index.html
<Directory "/Users/mhulse/github">
IndexOptions +FancyIndexing NameWidth=*
Options +Includes +FollowSymLinks +Indexes
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
Using the above, enable apache on your local machine.
Get IP address of your device by going to Settings
→ Wi-Fi
and click on the current network’s info icon:
Next, look under the “IP ADDRESS” section to find your phone’s IP address:
Download SquidMan.
Install it. Allow it to install what it needs to get going.
Open preferences; mirror these settings:
Input your device’s IP on the ”Clients” page:
On the “Template” page, add a #
(comment) at the beginning of the http_access deny to_localhost
line. For example:
# protect web apps running on the proxy host from external users
#http_access deny to_localhost
Immediately following, add this code:
# hosts file
hosts_file /private/etc/hosts
Save and “Start Squid” (can’t hurt to restart Apache).
On your iOS device, back in the current network settings, do this:
You should now be able to connect to your local machine’s vhost
s using your mobile device using spoofed domain from above (i.e., http://git.proxy); note that the http://
is required when trying to connect from you i-device.