Friday, October 2, 2009

This is a step-by-step guide for setting up a cyber cafe using only open source software. It was originally written for distribution in the ICT Toolkit made for Peace Corps Volunteers in Togo, and I've decided to post it online for the numerous folks it could help abroad. I haven't been satisfied with the resources available on this, so pulling from my experiences here in Togo, I decided to write a one-stop step-by-step how-to. I have written this guide as simply as possible so anyone can use it, but with the wide range of computer types, ages, and setups that you can run into, there will doubtless be many hang-ups and unforeseen problems beyond the scope of this simple guide. Therefore I would like to stress that I recommend having a certain level of comfort with Linux, most especially the terminal. There are many great online tutorials that are quick and simple that should help put you at ease even if you are a complete Linux novice. A good one I've run across is http://linux.org.mt/article/terminal. Alright, best of luck and if you do run into problems, you can always visit the Ubuntu forums - www.ubuntuforums.org, which have helped me times innumerable, or simply Google a solution.

It is also important to mention that this will only work for cyber cafes that have a constant connection to the internet – here in Togo you can use a wireless phone as a pay-per-hour serial modem, which many people want for a cyber, but there are no drivers for Linux. That's to say, you need to have the internet working on the server computer before this will work, obviously.

*Disclaimer*
First off, if you break your system using this guide, I hate it for you, but I can't help you – There is no way I can write something for every computer configuration that this will be used with, so just install Ubuntu (or Xubuntu), try this guide step-for-step and hope for the best. If it doesn't work exactly the same way, take a deep breath, go get a beer and come back and see if you can figure it out. I am in no way responsible for any problems that may arise. Seriously, though, theres not much you could do to mess anything up, so dive in!
*Disclaimer*

Why Linux?

If you are familiar with Linux already you already have plenty of reasons why you think open-source in the developing world is a good idea. For those of you who are new to the open-source world, anytime someone asks you about Linux, you can tell them this -

1. Linux is, plus ou moins, completely virus free. 99.999% of the viruses written are for Windows based computers and as such have absolutely no effect on a machine running Linux. Anyone who has been to a cyber cafe here can easily attest to how bad the problem has gotten through the proliferation of pen drives and outdated, pirated anti-virus software. I, for one, have never once seen a Unix-based virus running amok.

2. Customization – you can find a Linux distro to fit almost any situation or need. This comes in handy in Africa when you are working on machines that are a decade old and have problems running Windows. There are many streamlined distros of Linux that are made specifically for older computers.

3. Support – Linux is part of a nifty little agreement called the GNU/GPL. The general public license gives anyone with the gumption permission to alter the source code however they wish and re-distribute it. Once you start with Linux you will be part of a massive world-wide community who code and test updates so you never have to worry about out-of-date software.

4. Linux is free. F-R-E-E. The OS and all open-source programs can be downloaded free of charge and you can find an open-source counterpart to nearly any private software available for Windows. Working in an area of the world where any cost is prohibitive, this is an incredible advantage.

5. Linux is simple to use and anyone who is familiar with a Windows environment can easily switch to Linux without missing a beat.



Software

I originally provided ISOs of Ubuntu 8.10 and Xubuntu 8.10, but you will have to download them from www.ubuntu.com. I would recommend Ubuntu for just about anyone, with the exception of those running significantly older set-ups. Xubuntu is a streamlined version of Ubuntu that will work efficiently on many older machines without sacrificing usability. This has been taken directly from the Ubuntu website -

Recommended minimum requirements

Ubuntu should run reasonably well on a computer with the following minimum hardware specification. However, features such as visual effects may not run smoothly.

* 700 MHz x86 processor
* 384 MB of system memory (RAM)
* 8 GB of disk space
* Graphics card capable of 1024x768 resolution
* Sound card
* A network or Internet connection

Recommended for visual effects

Visual effects provide various special graphical effects for your desktop to make it look and feel more fun and easier to use. If your computer is not powerful enough to run visual effects, you can turn them off and will still have a usable Ubuntu desktop.

Visual effects are turned on by default if you have a graphics card which is supported. For information on supported graphics cards, see DesktopEffects.

* 1.2 GHz x86 processor
* 384 MB of system memory (RAM)
* Supported graphics card (see DesktopEffects)

Low-spec computers (Xubuntu)

If you have an old or low-spec computer, using a lightweight desktop system such as Xubuntu is recommended, as it should make more efficient use of your system's resources.

Recommended minimum requirements (Xubuntu)

* 300 MHz processor
* 256 MB of system memory (RAM)
* 8 GB of disk space
* Graphics card capable of 800x600 resolution

You can either install the ISOs you downloaded from a pen-drive, or burn them to CDs. If you are unsure how to go about doing that, just ask your IT person at your office and they will be able to help you. A word of advice – CCL will work with any Linux distro, but if you are going to be using a Linux distro that is NOT Debian-based (ie. Red Hat, or for the truly initiated Slackware or Gentoo), some of the following will be different for you. My suggestion is just to stick with Ubuntu if at all possible.


CCL – Café Con Leche – is one of the most popular, not to mention user-friendly cyber cafe programs for the open-source crowd. There will be 4 files -

cclfox-0.7.0.tar.bz2 and libccls-0.7.0.tar.bz2 for the server

cclcfox-0.7.0.tar.bz2 and libcclc-0.7.0.tar.bz2 for the clients

These are all downloaded here --> http://ccl.sourceforge.net/?page=download


ok, onto the main attraction--


Installation

For starters, after installing Ubuntu, we'll need to open up the software sources so you can download the required repositories. To do this, go to System --> Admin --> Software Sources (it will be Sources de mise à jour in a French setup.) These photos are from my desktop. I'm running Ubuntu 7.10, so there might be some minor differences in the menus.




Next, make sure that everything but 'source code' is checked and that you are downloading from the main server --




Now, as a quick side note, if you are using new installs you are going to want to be able to play restricted formats such as mp3, avi, DVDs, etc. Its a long, boring story as to why these are not available from the get-go with Ubuntu, but there is a very simple process for enabling them.


* Go to Applications → Add/Remove...
* Set Show: to All available applications
* Search for ubuntu-restricted-extras and install it. Note that there is also xubuntu-restricted-extras (for Xubuntu) and kubuntu-restricted-extras (for Kubuntu.)


Note: You MUST have allowed multiverse downloads for this to work (the box above 'source code' in the above photo).




Now, before we go any further I HIGHLY ADVISE you to download the system updates for your machine. This will clear up a lot of potential problems that can occur along the way and leave you pulling your hair out. You will need to do this on every computer individually. To do this, open a terminal window and type:

$ sudo apt-get update

Granted, this will probably take a while, but I can not stress how important this can be – I have gotten to the end of some nasty installations on lots of different systems only to have a tiny outdated-dependency problem bring it all to a halt. If you have to, just leave the download going through the night and it should be ready by the next morning, even on a dial-up connection.

Ok, at this point we need to download the dependencies needed for CCL.
The CCL depdencies are:
sqlite3
glib2.0
libfox1.4
openssl

I provided all of these in the toolkit here in Togo, but you will have to download them manually. This isn't much fun, but absolutely necessary. So, open a terminal window and copy the following commands there (omit the dollar sign, its just to show each command)-


$ sudo apt-get install sqlite3 libsqlite3-dev

$ sudo apt-get install libglib2.0-dev

$ sudo apt-get install libfox1.4 libfox1.4-dev

$ sudo apt-get install libssl-dev

$ sudo apt-get install build-essential

Next we need to edit a configuration file. To do that we need to dig it out of the computers innards and open it up. So, type:

$ gksudo gedit /etc/ld.so.conf

and add these lines :
/usr/lib
/usr/local/lib

Save and close the file and then do this:
$ sudo ldconfig

You will need to do all of this on EVERY COMPUTER IN THE CAFE!



Now its time to unpack the CCL packages. This will be done once for the main computer that will manage the cyber cafe – the server – and then will need to be done with the client package for every client in the cyber.

For the SERVER, place
cclfox-0.7.0.tar.bz2 and
libccls-0.7.0.tar.bz2
in your Home Folder and run the following commands (in order, of course),

$tar -xjvf libccls-0.7.0.tar.bz2
$cd libccls-0.7.0
$./configure
$make
$sudo make install
$cd ..
$tar -xjvf cclfox-0.7.0.tar.bz2
$cd cclfox-0.7.0
$./configure
$make
$sudo make install

Next, go to your desktop and right click on it. Click 'Create Launcher' and then name it what you like and in the 'Command' box add this - cclfox -nossl

For each CLIENT, place
cclcfox-0.7.0.tar.bz2 and
libcclc-0.7.0.tar.bz2
in your home folder then run these commands:

$tar -xjvf libcclc-0.7.0.tar.bz2
$cd libcclc-0.7.0
$./configure
$make
$sudo make install
$cd ..
$tar -xjvf cclcfox-0.7.0.tar.bz2
$cd cclcfox-0.7.0
$./configure
$make
$sudo make install

On the desktop, create a launcher just like before and in the 'Command' box add -
cclcfox -host -name -nossl

To find the server's ip, in a terminal window on the server, type

$ifconfig

and jot down the IP address for eth0 - it could be eth1 if you are using wireless, but that would be a rarity
the 'client name' is the name of the individual client computer. This can be found quite simply, just open a terminal window and read the first line thats automatically there – the client name is the name after the '@'. So, for example, my command box would read

cclcfox -host 192.168.210.225 -name spinner-laptop -nossl



Advanced Cafe Management

Alright, so you've got everything up and running and things seem to be going peachy – here are a few steps I recommend to keep everything flowing well – this may seem scary to the Linux un-initiated, but I'll make it as fool-proof as possible. Come on, take my hand, we'll do this together.

First off, you may want to use the server computer to shut down or reboot clients its managing. To do this we have to change the permissions on each of the client computers. This is telling the client computer that its OK to accept a kill signal or reboot signal from another machine. Without changing this, the client computer will ignore outside signals. So, open up a terminal window and type:

$ cd /sbin/
$ sudo chmod 7755 shutdown
$ sudo chmod 7755 reboot

2. You can change the lock screen display on the client by using a picture you like, save it as a gif and name the picture lockpix (therefore lockpix.gif). Open the terminal and type -

$ cd /Desktop
$ sudo make dir .cclcfox

Now we need to move the photo that you have to the directory you just made – we'll say it's named “mypic.gif” and its on the desktop

$ sudo mv mypic.gif /Desktop/.cclcfox


3. Secure your workstations, you don't want someone with a bit Linux knowledge do process listing and send kill signal to terminate the cclcfox application, or delete it from the start up list. This one gets a little more in depth, but not too much. Before we do this, we are going to need to add an administrator terminal in the menu. Once you disable terminal, you wont be able to open it back up to sudo into it!

* So, go to System --> Preferences --> Main Menu
* Find 'System Tools' there on the left and check 'Root Terminal' there on the right
* Go to Applications --> System Tools and now you can get a terminal whenever you need it on
your clients

So, open up a terminal window now and type:

$ cd /usr/bin
$ sudo chmod o-x gnome-system-monitor xterm gnome-terminal gnome-session-properties

This is going to block anyone other than admin with the sudo password from opening terminals or the system monitor, where they can effectively shutdown CCL or any other number of naughty things. If for any reason you want to undo this, just open up your root terminal that you just added to the menu and type:

$ cd /usr/bin
$ sudo chmod o+x gnome-system-monitor xterm gnome-terminal gnome-session-properties

Now as a final precaution you can disable TTY, but it takes someone with a good deal of Linux knowledge to ctrl+alt+Fx (F1, F2, etc) into TTY, ps aux, then killall cclcfox. If you didn't understand what I just wrote, then chances are not too many people out there will either (for the truly interested, just search for “TTYs” in google or wikipedia)! But, just to be thorough, here's the skinny on how to disable your TTYs-

So lets open up that lovely administrator terminal you just put in place and type:

$ cd /etc/default/
$ gedit console-setup

Replace ACTIVE_CONSOLES="/dev/tty[1-6]" with ACTIVE_CONSOLES="/dev/tty[0]"
Save the file

Now back in the terminal type:

$ cd /etc/event.d

$ gedit tty1

Comment all the lines that begin with 'start' (this means put a '#' in front of them. For example, 'start on stopped rc2' becomes '#start on stopped rc2' and so on).

Do the same for the each 'tty' (you can see how many there are with the 'ls' command. There should be tty1-6). Meaning:

$ gedit tty1
$ gedit tty2
$ gedit tty3
$ gedit tty4 and so on...



Du Courage!

So there we have it – you are now set up with CCL. You can find tutorials online dealing with the details of setting up CCL. Most of this would probably revolve around pay-schemes. I hope this helped you wherever you are! If you have any questions, I can't promise a response, but I may be able to help – dvoyage@gmail.com.

--Matt Tedder, PCV Togo '08-'10