If you're developing a website and you'd like to show a colleague in the same office what you're working on, free services like nip.io and xip.io make it easy to get connected to your computer from any other computer on your subnet.
However you need to configure your Apache web server to respond properly to these addresses. This implementation provides you with a zero-configuration approach to setting up projects to be accessed on your local home or workplace network.
Enable the VHOST module
There are two ways that you can enable the
module for Apache.
Option 1: if you're using an operating system that supports
a2enmod, connect to your server (e.g.: via SSH) and type the following:
$ sudo a2enmod vhost_alias $ sudo service apache2 restart
Option 2: Edit Apache's
and make sure that you have
# Make sure there is no hash (#) symbol in front of this next line: LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
Configure your Virtual Host
You will need to add the following code to your Apache configuration: either create a new site in
(recommended) or in the file
<VirtualHost *:80="*:80"> ServerName www.127.0.0.1.nip.io ServerAlias *.xip.io ServerAlias *.nip.io VirtualDocumentRoot "/Sites/%-7.0/public" </virtualhost>
Map URLs to paths
Next you need your computer's IP address. Open your terminal and type the following command:
If your IP address is: 192.168.0.10 you can go to either one of the following URLs on another computer:
And the contents of the following directory will be served:
Extending the Virtual host
You can retrieve any part of the URL and use it in your
using the indexed parameters. Find
more information about
from the Apache documentation.
# Given the URL: project-name.client-name.192.168.0.10.nip.io %-1.0 io %-2.0 nip %-3.0 10 %-4.0 0 %-5.0 168 %-6.0 192 %-7.0 client-name %-8.0 project-name
Think someone else might like this page?