the fast, reliable localhost tunneling solution


Link a Domain Name to a Diaspora Pod on a Local Network Computer

By Dana Priesing 2011-12-10, 14:32

Diaspora is an open-source, decentralized social network. Think Facebook without the datamining. You can find instructions for installing Diaspora on your computer here. A Diaspora server is called a pod. Each user account within a pod is called a seed. The various pods communicate with one another, collectively creating the Diaspora network.

Once you've installed and correctly configured Diaspora, you should have a valid SSL certificate, the nginx webserver listening on localhost:80 and localhost:443 (and redirecting localhost:80 calls to localhost:443), and proxying localhost:433 to localhost:3000, where the thin app server should be listening. That may seem somewhat complicated, but you can find sample nginx config files to help you with the setup here.

Even after you've successfully configured nginx, however, the webserver will not be visible to the internet yet, because it is likely hidden behind NAT IP addresses assigned by your ISP and your local area network. That is to say, your nginx webserver's IP address likely is something like 192.168.2.6:443, which is not an address reachable from other computers on the internet. Pagekite is a simple way to make the nginx webserver visible to the internet. Here's how (substitute your particulars for the examples in the brackets below):

Create a Domain Name

Go to GoDaddy, VeriSign, or the like, and register a domain, for example, [yourdomain.net].

Create a Pagekite Account

Open an account at pagekite.net, and create a pagekite, for example, [yourname].pagekite.me. Download the pagekite software and install it (preferably using the RPM or Debian packages). Make note of where the configuration files are located on your computer afterward. For example, on a computer with Linux as its operating system, the configuration files may be found at /etc/pagekite.d/.

Create a CNAME Record

Go back to your domain registrar, log in to your domain name account, and create a CNAME record that points to your pagekite. For example, create the CNAME diaspora.[yourdomain.net], and point it to [yourname].pagekite.me. Your domain registrar will have instructions on how to do this. The process will vary by domain registrar.

Edit the Pagekite Configuration Files

Now you want to direct the URL diaspora.[yourdomain.net] through your [yourname].pagekite.me kite to your computer, where your nginx webserver is listening at port 443. Using a text editor, edit your pagekite configuration files as follows. The file /etc/pagekite.d/10_account.rc should contain the following values:

kitename=[diaspora.yourdomain.net]
kitesecret=[your account secret from your pagekite account]

Be sure to delete from this file the line which prevents the service from starting up, if it is present.

The file /etc/pagekite.d/80_httpd.rc should contain the following:

backend=http:[yourname].pagekite.me:localhost:80:@kitesecret
backend=http:@kitename:localhost:80:@kitesecret
backend=https:[yourname].pagekite.me:localhost:443:@kitesecret
backend=https:@kitename:localhost:443:@kitesecret

Test

If your pod is running, and you've started the pagekite service (for example, using the command service pagekite start in a terminal as su or sudo), you should now be able to find your login screen in a browser window at https://diaspora.[yourdomain.net].

Avoiding nginx Altogether

While it isn't the preferred way to do things (you won't be able to use SSL, and pods that require SSL won't connect with your pod), it is possible to use pagekite to route traffic from your diaspora subdomain name straight to the Diaspora app server listening at localhost:3000 on your computer. If you want to do that, your /etc/pagekite.d/80_httpd.rc file should contain the following:

backend=http:[yourname].pagekite.me:localhost:3000:@kitesecret
backend=http:@kitename:localhost:3000:@kitesecret

Relocating Your Pod

If you change local network locations (for example, you take the laptop hosting your pod to an internet cafe), you'll need to restart Pagekite to update your DNS settings. Simply open a terminal and type service pagekite restart as su or sudo.

Comments

None yet, you can be first!

Leave a comment

( (Please leave these blank: )

We use Gravatar for commenter's photos. Get your own, it's free!