2.7. RedHat (8.0)

Author: Yudhvir Singh Sidhu, Yudhvir@hawaii.edu

Date Created: 4 Nov 03, modified 06 Nov 03 by Yudhvir

What I did :Moved pypgSQL to client side and added stuff on how to drop a database.

Disclaimer: No guarantees if these instructions will work or cause any damage.

Refinement is needed, so please send me your suggestions. I'll make changes and send it to the listserv. Since I do not have any other Linux flavor, I am limited to RedHat.

2.7.1. Introduction

2.7.1.1. General

I divided gnumed installation in two parts: client-only and client + server. The division is important because the client install is relatively easier and you can use it to connect to a remote database and play with the screens. As you can tell, the database part is being called the server. Both installs require cvs download of the module "gnumed."

2.7.2. Preparation

2.7.2.1. Notes

Download these files. If you have the RH 8.0 set of 5 cds, many of these files are on cds under the RPM directory. Get them together first, the order in which they are installed is important. I'll list that later. NOTE: RedHat's GUI rpm "Package" GUI utility works and is simpler to use than the command line because it figures out dependencies and installs them also. However, it sometimes hangs. Maybe "hangs" is not the right description, it hides so you don't see it on your screen and won't let you install the rpm package. You have to logout and log back in or kill the process. NOTE: It is important that you get the right versions of all these rpms that match your RedHat release. gnumed.org's cvs download directories show which versions belong to which RedHat release.

2.7.2.2. Prepare for Client

  1. Python Scripting Language from python.org, version 2.2. I used version 2.2.1 installed via the Red Hat "Packages" GUI under "System Settings." The GUI prompts you to put in the right cd, so you don't have to know which one the software is on. gnumed.org reminds us to "Don't forget to include the Python interface libraries." I have no idea what rpm these files are in or what their names are, but apparently they are loaded as part of the python package by the GUI install of python.

  2. GTK libraries from gtk.org, version 1.2, If you have a Gnome windows manager, you probably have these libraries installed. Please keep in mind that KDE uses QT instead of GTK. So, if you have a KDE-only setup, you will have to install these from the rpms on cd or the net. My RedHat setup includes both KDE and GNOME - so I did not have to install these.

  3. mx extension libraries from mx, no version given from lemburg.com/files/python/eGenix-mx-Extensions.html . I used egenix-mx-base-2.0.5-py2.2_1.i386.rpm. RedHat 8.0 cd contains the mx-2.0.3-6.i386.rpm.

  4. wxWindows windowing library from wxwindows web site, version 2.4. I used wxGTK-static-2.4.2-1.i386.rpm

  5. wxPython from wxpython.org, version 2.4. I used wxPythonGTK-py2.2-2.4.2.4-1.i386.rpm

2.7.2.3. Prepare for Server

  1. The libraries: I used postgresql-libs-7.2.2-1.i386.rpm from the RH 8.0 install cds

  2. The database: I used postgresql-7.2.2-1.i386.rpm from the RH 8.0 install cds

  3. The server: PostgreSQL Database server from postgresql.org, version 7.2. I used postgresql-server-7.2.2-1.i386.rpm from the RH 8.0 install cds

  4. PyPgSQL from www.pypgsql.sourceforge.net, version 2.3. I used pyPgSQL-2.3-1.rh80.i386.rpm

2.7.2.4. Create gnudb User Account

Log in as root and create the user account.

2.7.2.5. Get gnumed via CVS

You need not know anything about cvs, just run these commands as user gnumed:
mkdir gnumed 
export CVS_RSH="ssh"
cvs -d :ext:anoncvs@savannah.gnu.org:/cvsroot/root
NOTE: you really do not need to create this directory. I did and all my examples follow that path. NOTE: There is no password. Hit enter when it asks you for it. This takes some time and brings down all the software and puts it into a directory called gnumed. You will end up with two or three gnumed directories. One created for the user account, the second that you created in 3a above, and cvs creates the third.

2.7.3. Installation

2.7.3.1. General

If you are doing a clinet+server install the software should be loaded in the following order. That is the order I followed successfully.

  1. python - I assume the libraries are loaded at the same time.

  2. GTK libraries

  3. mx extension libraries

  4. PostgreSQL Database server - load the libs first, then the database and lastly the server:

    1. postgressql-libs

    2. postgresql database

    3. postgresql server

  5. wxWindows windowing library

  6. wxPython

  7. PyPgSQL

However, if all that you are doing is a client install, I think you can get away with going with the following:

2.7.3.2. Install Client

Install the rpms in this order:

  1. Python and the libraries [This should already be installed. If not, use the RH package manager GUI.]

  2. GTK libraries [This should already be installed. If not, use the RH package manager GUI.]

  3. mx

  4. wxWindows windowing library

  5. wxPython

  6. pyPgSQL

2.7.3.3. Install Server

Most people would not install just the server and I did not do that. I am guessing that if you wanted to do that, you would only load:

  1. postgressql-libs

  2. postgresql database

  3. postgresql server

  4. pyPgSQL I HAVE BEEN TOLD: This is Needed on the client, mainly. Only needed on the server machine if one is doing the bootstrapping on that machine.

  5. Then, obviously you would need to create the gnumed database and the bootstrap directory has the scripts. I ran the monolithica one I call mono when doing a complete install.

2.7.4. Configure Files and Setup Environment Parameters

2.7.4.1. PYTHONPATH and GNUMED_DIR

I HAVE BEEN TOLD: GnuMed should run without GNUMED_DIR in most circumstances. One only needs to set it if GnuMed absolutely cannot find its files. [I needed to set it on my RH 8.0 system.]

  1. as root: find / -name site-packages

  2. Copy that full path down

  3. As user gnumed: vi ~/.bashrc - I am assuming you are running the bash script. It is okay if this file does not exist, vi will create it. Put that directory name in using the export command as below. My lines are:
    export PYTHONPATH=/usr/lib/python2.2/site-packages
    
    export GNUMED_DIR=/home/gnumed/gnumed/gnumed/client

  4. source ~/.bashrc [this will make that an environment variable. You can check it by typing env|grep PYTHONPATH]

2.7.4.2. pg_clog, postgres.conf and PGDATA

[NOTE: you can skip this part for a client-only install]

  1. su - postgres - This should put you in the postgres home directory

  2. cd data - the actual path on my machine is: /var/lib/pgsql/data

  3. vi pg_hba.conf - uncomment the "local all" and the "host all" lines towards the bottom of the file.

  4. vi postgresql.conf and uncomment tcpip_socket line and edit it to read:
    tcip_socket = on

  5. uncomment the line: port = 5432

  6. exit out of user postgres and come back to user gnumed

  7. vi ~/.bashrc and add this line:
    export PGDATA=/var/lib/pgsql/data

2.7.4.3. Shortcut Scripts mono and check_log, set password and Configure Files

[NOTE: you can skip this part for a client-only install]

  1. as user gnumed, cd to the server/bootstrap directory. Mine is cd /home/gnumed/gnumed/gnumed/server/bootstrap

  2. vi mono and put this line in it:
    python bootstrap_gm_db_system.py --conf-file=bootstrap-monolithic_core.conf

  3. exit and type: chmod 744 mono

  4. vi check_log and put this line in it:
    tail -100 /home/gnumed/.bootstrap_gm_db_system/bootstrap_gm_db_system.log
    NOTE: If your logfile is somewhere else, su - root and do a find / -name "*log*"

  5. exit and type:
    chmod 744 check_log

  6. as user gnumed and in the bootstrap directory, run ./make-links.sh I HAVE BEEN TOLD: This is not needed anymore in normal circumstances.

  7. su to root and type passwd postgres and set the password. This sets a password for the system user 'postgres' which is different from the database user 'postgres' I HAVE BEEN TOLD: This is not needed. [I chose to create a password because I can su into postgres from any user. I do not have to jump to root to get into postgres.]

  8. in the bootstrap directory vi bootstrap-monolithic_core.conf and uncomment BOTH password lines for gm-dbo and postgres and type in the passwords. Select a password for gm-dbo. I selected the same one I use for the gnumed user account. I HAVE BEEN TOLD: Many setups use the same name for both thesystem level user account "postgres" under which the postgresql data files are installed in the filesystem and for the database superuser. Those accounts are actually unrelated entities. They need not have the same password. In fact, the system account postgres need not have a password at all. It is sufficient to be able to su - to it from root. It helps to have a password for the DB account "postgres", though.

2.7.5. Run Client

  1. as user gnumed, cd to the ....client/wxpython directory. Mine is cd /home/gnumed/gnumed/gnumed/client/wxpython

  2. ./gnumed.sh - this should bring up a login GUI. If the GUI comes up, you have successfully installed the client.

  3. Write an e mail to "Karsten" and request a hostname, a username, and a password and input them into the GUI. Under the "options" button, select "gnumed" and put in the hostname and leave the port as 5432. In the main GUI, input username and pasword. NOTE: If Karsten gives you "anydoc" as the username and password, he actually means any-doc for both fields. Also NOTE: You should be logged onto the net when you do this, I was user gnumed when I did it.

  4. If the GUI does not come up:

    • lookup the logfile - mine is created at: /home/gnumed/.gnumed/gnumed.log

    • gnumed.sh tells you where it is creating one

    • input the error into google and see what comes up

  5. If your error lists files "gmCLI" and "gmLog" - the error actually means files "gmCLI.py" and "gmLog.py" These files are on your system.

  6. This error means that your GNUMED_DIR environment variable is not set to ".....client" directory. Do an env| grep GNUMED_DIR or do an echo $GNUMED_DIR to see if it is set correctly. See section above.

2.7.6. Run Server

  1. log out of the gnumed account and log back in for all the environment variables to take affect

  2. su - postgres and type pg_ctl restart

  3. exit out of user postgres and back into user gnumed

  4. in the bootstrap directory, type ./mono

  5. A loooooooong list will start scrolling by - leave it alone. It will list errors, many of them. Let it run. It should give you a satisfying message: "Done bootstrapping: We probably succeeded." I HAVE BEEN TOLD: We now log this list. It doesn't scroll by anymore.

  6. su - postgres and do pg_ctl restart - just for good measure.

  7. Click on the redhat logo and bring up the services GUI - it is under Server Settings. Check the postgres box for the service to load upon bootup.

  8. Now you can start your client - see 6b above. Except you will not be connecting to a remote server. Your database is gnumed and your host is localhost. Use the gnumed password and the application should come up.

  9. If you stopped the mono process the first time, which creates the database, with a control-c like I did thinking the long scrolling list is not what I should be seeing: ====> you have to drop the half-created database and re-run mono again. Otherwise mono will not run all the way and you do not have a functioning server. Since I have "webmin" running, I used that to drop the database gnumed. Otherwise, on the command line as any user you could:
    dropdb -U postgres gnumed

  10. There are other instructions in the gnumed.org installation writeup about how to create a real life instance. I have not reached that far - so I cannot say anything about it.