Sandvox Help
Index

# Preparing for Publishing to Your Computer

Sandvox allows you to publish a site to your computer. However, getting everything properly set up for people visiting your site over the internet can be tricky.

Every computer on a network has an IP address. This is a number that defines where on the network the computer is. To access a site published on your computer, people need a way of getting an IP address that uniquely identifies your computer on the internet.

There are two basic possible ways in which your computer could be connected to the internet. In either case, you will need to know the IP address through which you are connected to the internet.

To find the IP address for your internet connection, visit http://whatismyip.com

### Direct Internet Connection

Computer connected directly to the internet.
(The address shown is just an example)

This is the simplest case and is usually only found in homes where a single computer is connected to the internet. This makes publishing to your computer simpler since it is directly contact-able from the Internet.

### Internet Connection Through a Router

Computer connected to the internet through a router.
(The addresses shown are just examples)

This configuration is more common, since it allows multiple computers to share the same internet connection.

Your computer has an IP address on the internal network, but not one that is directly accessible from the internet. The router is the only device with an external IP address that can be contacted from the internet. Thus, you must instruct the router that any requests for web pages should be passed onto your computer. This is known as port forwarding.

Port forwarding in action

To set up port forwarding for webpages:

1. Open System Preferences on your computer.
2. Go to the "Network" preference pane.
3. Double-click the interface you are connected to the internet with.
4. Go to the "TCP/IP" tab. Take note of your IP address and the address of your router there.
5. Consult your router's manual for how to set up port forwarding. Configure the router to forward port 80 to the IP address of your computer.

## Dynamic DNS

For people to visit your site, they must know the IP address of your computer. This is not a problem if your ISP (Internet Service Provider) has issued you with a static IP address. However, many ISPs issue dynamic IP addresses. This means the IP address of your internet connection can change at any time.

To compensate, a service such as Dynamic DNS can be used. You are given a unique hostname which is used to access your computer and websites. The service keeps track of your IP address and automatically ensures that visitors are pointed to the correct location.

The sequence of events looks something like this:

1. Visitor enters your hostname. e.g. http://example.com
2. Dynamic DNS service looks up the current IP address for that hostname. Passes request onto that address.
3. Your computer receives the request and serves the appropriate webpage.

## Web Sharing

For your computer to serve webpages, you must be running a web server. The easiest way to do this is to use OS X's Web Sharing feature.

To enable Web Sharing (OS X 10.7 and earlier operating systems):

1. Open System Preferences.
2. Go to the "Sharing" pane.
3. Go to the "Services" tab.
4. From the list of services, check the "Personal Web Sharing" box.

To enable Web Sharing (OS X 10.8 and up):

Personal web sharing is possible, but it can no longer be controlled directly from Apple's preferences. You can download and install this preference pane for controlling web sharing from Tyler Hall to enable web sharing.

## Related Articles

- Publishing to your Computer
- Publishing a site for use in an intranet

Keywords: publish, publishing, computer, published, local, locally, dynamic, dns, dyndns, network, networks, internal, lan, port, ports, forward, forwards, forwarding, router, routers, routing, nat, prepare, prepares, preparing, require, requirements

How can we improve this page? Let us know.