Projects

Nano Address Book

Nano Address Book

This is a personal, live demo, just for you! Feel free to make changes and experiment. Your changes will only be visible to you—no one else. If you leave the demo alone for more than five minutes, it will reset itself to its original values.

If you’d like to have a little address book like this on your website, then follow the instructions below. You’ll get your own (password-protected) address book, where you can save your contact information permanently.

0. Prerequisites

You will need a Linux web host with PHP 5.3 or later.

If your web host doesn’t support the minimum requirements, then you’ll be notified during the installation process.

1. Download

Log in to your website through SSH:
ssh username@example.com

Download and extract your Nano Address Book:
curl -O http://spencermortensen.com/projects/nano-address-book/nano-address-book.zip
unzip nano-address-book.zip && rm nano-address-book.zip

2. Configure

You should now have two folders in your home directory: nano-address-book and contacts. The nano-address-book folder contains the source code and data. The contacts folder is the public interface to the world: it sends web requests to the address book.

This is the full path to your nano-address-book:
ls -d ~/nano-address-book

Make note of this path; you’ll need it in a moment.

Open the contacts/index.php file:
nano contacts/index.php

Inside this file, you should see a line of code like this:
include '~/nano-address-book/check.php';

Replace “~/nano-address-book” with the full path to your nano-address-book:
include '/home/username/nano-address-book/check.php';

This ensures that your website will run, no matter how your web host has configured the web server.

3. Install

The contacts folder should be made public now. Move the contacts folder to the base of your website:
mv contacts ~/example.com/

You’ll need to change “example.com” to the base folder of your website. Usually, this is a folder with the same name as your website (such as example.com), or a folder called public_html.

Visit your address book

It’s time to visit your address book! Open your web browser and go to the location of your address book:
http://example.com/contacts/

If everything is perfect, then you’ll see your address book now! Otherwise, you might need to follow a few additional instructions first.