Llama setup for FGdb

From FreekiWiki

Jump to: navigation, search

Contents

STOP

FGdb development is in a messy stage right now, so all of this information is wrong. Please talk to richard or martin if you would like to work on the software.

This is a step by step procedure that new coders should go through at orientation or at their first coders workshop. It is most important for coders who need to set up an environment for working on the FGdb project, but it is also useful for those working on related projects such as FGdiag.

Get your accounts

An administrator will need to give you three accounts:

An account on llama
This is a standard shell account to a workspace for developing code at Free Geek, accessable from inside Free Geek and outside. You need:
  • a username
  • a regular linux password
An RT account
This is to track work on bugs and feature requests. You need:
  • a username
  • an email address
  • your real name
  • an insecure password (This should not be the same as the password on llama.)

Connect to llama

From an anonymous account in the classroom, use Ctrl-Alt-T to open a terminal window. In the following example, you're connecting from an anonymous account called class28 on a machine called joe. You need to ssh to llama. Here's the command:

 class28@joe:~$ ssh user@llama.freegeek.org

(You may need to type yes to accept the host key.)

Enter your llama password at the prompt.


Look around on llama

See what's in your home directory. In the following examples, you're connecting as a user named user to the machine called llama.

 user@llama:~$ ls -l

You should see something like this:

 total 3
 lrwxrwxrwx   1 user   user     29 Some Date    html -> /var/www/html/phpclass/user
 lrwxrwxrwx   1 user   user     27 Some Date    phpclass -> /usr/local/groups/phpclass/

Set up some configuration files

Get a standard FGdb database configuration file:

 user@llama:~$ cp phpclass/db.inc.php .

Get a standard vim configuration file (if you will be using vim as your editor):

 user@llama:~$ cp phpclass/vimrc .vimrc

Now, edit the db.inc.php file. Change the two USERNAME_GOES_HERE lines to use your username.

Edit the db.inc.php configuration file

Change the values for $userid and $database to your username.

Get a current copy of the FGdb base code

(This may be useful even if you are working on FGdiag, since it gives you the scripts necessary to creating a test copy of the database.)

Change to your web page directory and check out a current copy of the code base:

 user@llama:~$ cd html
 user@llama:~/html$ svn co http://svn.freegeek.org/svn/fgdb/trunk fgdb/trunk 


If you have an svn account, you can check out this way instead:

 user@llama:~/html$ svn co svn+ssh://svn.freegeek.org/svn/fgdb/trunk fgdb/trunk 

You may need to type yes to accept the host key. Enter your svn password at the prompt. There will be a long list of created files.

Create a test copy of the database

Change to the fgdb/sql subdirectory and run a script that will create a copy of the database and populate it with test data:

 user@llama:~/html$ cd fgdb/trunk/sql
 user@llama:~/html/fgdb/sql$ ./createtestdb


Do a reality check

Your working database aplication should be viewable in a web browser at http://llama.freegeek.org/phpclass/YOURUSERNAME/fgdb/trunk/php/

(Remember to replace the word YOURUSERNAME with your actual username.)

An error that could be displayed in your browser at this point is:

  Fatal Error: Call to a member function on a non-object in /usr/share/php/fgdb/std_head.php on line 87

(If you see that, it likely means the database is not set up properly.)

Otherwise, you'll probably see a working copy of the FGdb application.

Where stuff is

In your home directory, there are two links to other directories set up by default.

phpclass
This is where we keep common files, such as configuration examples. The files in here are shared by all coders. Do not edit these files. Copy them to your home directory instead.
html
This is where you can create web pages, for instance index.html or index.php and try stuff out. It is therefore also where you initially check out a copy of the FGdb code.
html/fgdb/trunk/
This is the root directory of your working copy of the codebase.
html/fgdb/trunk/sql/
This where scripts for setting up and modifying the database go.