Gabriele Cicala wrote: > An italian user has tryed to install the care2x_d22_full.tar.gz on an > Ubuntu 7.10 but this was installed with PHP5 (actually the > 5.2.3-1ubuntu6.4 release). And Care2x is not PHP5 compliance. > On the official repository there are no trace of a PHP4 release. > > Someone of you has had the same problem?
Yes. > Or may be are there some repository that can permit to this user to > install the old PHP release? While waiting for the ever it-is-almost-done Care2x/PHP5, just try this from our mentor here at e-HealthExpert.org. It is not pretty, but it "just works". *How To Install Care2x (2.4_rc2) in Ubuntu Linux* Care2x <http://www.care2x.org/> is a free Hospital Information System supporting software package. The following procedure describes How To install the Care2x software package in Ubuntu Linux (8.04 LTS) 1. Introduction Install Care2x in Ubuntu Gutsy (7.10) inside a chrooted Ubuntu Dapper (6.06) LAMP. In this article we will detail how we managed to install the Care2x <http://www.care2x.org/> Hospital Information System (HIS) supporting software package into a Ubuntu Gutsy (7.10) Linux system. In fact, in order to achieve very low hardware costs, easy system maintenance and administration and to make the system secure and user proof, we opted to use Clustered Ubuntu Gutsy (7.10) Servers to serve cheap Linux thin client terminals (one server for each set of 25 terminals). These thin terminals, do not have more than a LCD screen, a box with a 1 GHZ CPU, 1 GB of RAM, the usual video, keyboard+mouse and USB ports (for pen disks) and a PXE capable RJ45 network port . We are using inexpensive gigabyte switches to keep these connected without any bandwidth issues. The software used to operate the thin client magic is the now reliable and finally acceptably fast-booting Ubuntu's supported Linux Terminal Server Project Version 5 (LTSP5). As LTSP5 really shines over Ubuntu Gutsy (7.10) Linux, that was the system that we used to install at our servers. The Care2x HIS supporting software is an integrated 3 layered web paradigm based software. That means that you may install over whatever hardware or operating system that supports Apache+PHP+DBMS (DBMS being at present MySQL or PostgreQL ). At the user side there is no need for any special hardware or software as user interaction with the Care2x software is made using a plain and simple Web Browser (we used Mozilla Foundation's Firefox <http://www.mozilla.com/en-US/firefox/>, but Care2x is known to work equally well with MS Internet Explorer or Apple's Safari). If the user has any previous experience at surfing the Internet, then he will be at home with Care2x. Sadly, currently Care2x has several problems running over the newest PHP and Apache versions that come bundled with most recent Linux distributions like Ubuntu Gutsy (7.10). We tested more than a few setups and for now this was what we found more reliable (*1) : • Apache 1.3.3x • PHP 4.4.4 • Mysql 5.0.3x • PhpMyAdmin 2.9.1.x • Care2x 2.4_rc2 With that in mind we needed to choose a distribution able to support some of these vintage applications. We opted to install Care2x over Ubuntu 6.06.1 LTS (Dapper Drake) for no other reasons than the main system was already an Ubuntu system, which is generally a robust and very well supported distribution, and, most important Ubuntu 6.06.1 LTS will continue to be supported by Ubuntu <http://www.ubuntu.com/> until 2009. So, an Ubuntu Dapper (6.06.1) was installed inside a chroot container that we created inside the server's Ubuntu Gutsy (7.10) system. All these got along together very well and the systems are reliable running since their installation. (*1) 2007.02.11 Update: [EMAIL PROTECTED] reported that he managed to make Care2x 2.4_rc2 work with php 5.2.2 Here's what he did: Edit file include/inc_environment_global.php: In line 82 change from: ini_set('session.save_handler','user'); to: ini_set('session.save_handler','files'); In line 102 change from: include_once($root_path.'classes/adodb/session/adodb-session.php'); to: // include_once($root_path.'classes/adodb/session/adodb-session.php'); All this assuming that you have enabled session in your php.ini. Lets start the HOWTO procedure. 1. Install debootstrap & schroot We used debootstrap to install Ubuntu 6.06. so: • sudo aptitude install debootstrap We find it simpler to use Debian's schroot application to do all our chroot activities, so: • sudo aptitude install schroot Create the directory that will contain the chrooted system: • sudo mkdir -p /home/dapper Configure the chrooted environment • sudo gedit /etc/schroot/schroot.conf [dapper] type=plain #type=directory description=Ubuntu Dapper 6.06 location=/home/dapper priority=3 users=user_name1 #root-users=user_name1 groups=chroot root-groups=root 2. Install Ubuntu Dapper (6.06.1) in a chroot container inside Ubuntu Gutsy (7.10) Download an Ubuntu Dapper (6.06.1) Server .iso image, open a terminal and: • wget http://releases.ubuntu.com/releases/6.06.1/ubuntu-6.06.1-server-i386.iso Burn it into a bootable CD using the nautilus integrated Cd burning application. Insert the CD just made in the CD reader and: • sudo debootstrap --arch i386 dapper /home/dapper file:/media/cdrom0/ubuntu Change some paramaters: • sudo cp /etc/resolv.conf /home/dapper/etc/resolv.conf • sudo cp /etc/apt/sources.list /home/dapper/etc/apt/ • sudo sed -i s/gutsy/dapper/g /home/dapper/etc/apt/sources.list #point apt-get to the right release • sudo mount -o bind /proc /home/dapper/proc • sudo cp /etc/passwd /home/dapper/etc/ • sudo sed 's/\([^:]*\):[^:]*:/\1:*:/' /etc/shadow | sudo tee /home/dapper/etc/shadow • sudo cp /etc/group /home/dapper/etc/ • sudo cp /etc/hosts /home/dapper/etc/ # avoid sudo warnings when it tries to resolve the chroot's hostname • sudo cp /etc/sudoers /home/dapper/etc/ • sudo mkdir -p /home/dapper/media/cdrom0 # only if you plan to use the cdrom from the chrooted Ubuntu At the end of this procedure you will be needing to know who is installing the system, so write the result of the following command in a piece of paper: • whoami Now lets enter the chroot container: • sudo chroot /home/dapper /bin/bash # Or, better yet, use: schroot -c dapper Inside the chrooted container execute: • dpkg-reconfigure passwd • passwd <your first ubuntu user in the admin group> # usually this is the administrator of the chrooted system • apt-get update && apt-get upgrade Install the relevant locales to your country (here we used the USA and locales): • apt-get install locales # prepare to install your locales • locale-gen en_US.UTF-8 # change to your locale • apt-get install language-pack-en language-pack-pt # if you need the full native language packs, change pt to your locale Change the chrooted system time zone: • tzselect echo "TZ='Europe/Paris'; export TZ" >>~/.profile #Configure and use our local time instead of UTC echo chrooted > etc/debian_chroot # this is cosmetic: precede chroot command prompt by the word chrooted exit # exit the chroot system 3. Install a LAMP (Linux-Apache-Mysql-Php) System ATENTION: The following commands should be done while INSIDE THE CHROOT environment Install the Apache, Mysql and Php: • apt-get install apache • apt-get install php4 libapache-mod-php4 php4-gd php4-mcrypt php4-imap php4-mcal • apt-get install php4-mysql mysql-server • apt-get install phpmyadmin NOTE: curent Care2x seems to need the following php modules: GD, IMAP, Calendar, TTF Uninstall any residual Apache2 libraries: • dpkg -r libapache2-mod* The next one was tricky to find. It is needed to enable MySQL's php4 support • apt-get remove --purge apache2-common If, for any reason, you need to uninstall this LAMP system, uninstall it with: • rm -rf /etc/apache* /var/log/apache2 /var/lock/apache2 /etc/default/apache2 • apt-get remove --purge apache mysql* php* libapache* phpmyadmin Change Apache and PHP config files: • sed -i "s/DirectoryIndex index.html index.htm index.shtml index.cgi index.php/DirectoryIndex index\.php index\.html index\.htm index\.shtml index\.cgi/g" /etc/apache/httpd.conf • sed -i "s/#AddType application\/x-httpd-php \.php/AddType application\/x-httpd-php \.php/g" /etc/apache/httpd.conf • sed -i "s/#AddType application\/x-httpd-php-source \.phps/AddType application\/x-httpd-php-source \.phps/g" /etc/apache/httpd.conf Check if the mysql.so module needs to be enabled. • grep mysql.so /etc/php4/apache/php.ini If grep only finds a commented entry like ;extension=mysql.so execute: • sed -i "s/;extension=mysql\.so/extension=mysql\.so/g" /etc/php4/apache/php.ini Check if the gd.so module needs to be enabled. • grep gd.so /etc/php4/apache/php.ini If grep only finds a commented entry like ;extension=gd.so execute: • sed -i "s/;extension=gd\.so/extension=gd\.so/g" /etc/php4/apache/php.ini Now lets restart the system: /etc/init.d/mysql restart && /etc/init.d/apache restart Latter, when all else will be running smoothly you will be able to reboot the chrooted LAMP system with: • schroot -c dapper sudo /etc/init.d/mysql restart && schroot -c dapper sudo /etc/init.d/apache restart Or , you may arrange to run the following shell script as a service started each time the main server (the one that has Ubuntu Gutsy 7.10 and the LTSP5 system) is (re)booted. #!/bin/bash echo rebooting LAMP system schroot -c dapper sudo /etc/init.d/mysql restart && schroot -c dapper sudo /etc/init.d/apache restart sleep 10 To do a quick check if all went well, while still inside the chroot, execute: • bash -c 'echo -e "<?php\nphpinfo();\n?>" > /var/www/phpinfo.php' Point your browser to: <http://localhost/phpinfo.php> Check if you get the php settings page and if the relevant modules are being loaded. Do not miss MySQL. Add user that you found before with the "whoami" command. adduser user_name_in_ubuntu # 4. Install Care2x • sudo mkdir -p -m 1777 /home/dapper/var/www/care • sudo tar xvzf care2x_2.4_rc2.tar.gz -C /home/dapper/var/www/care • sudo chroot /home/dapper /bin/bash # enter chroot • start a browser and browse to: http://localhost/care/installer/install.php • choose admin name and password • the path to care should be: localhost/care • say NO at the prompt to install any ICD10 database ATTENTION: If you get an error about not being able to rename the file "install.php". Just open a console and execute: mv /var/www/care/installer/install.php /var/www/care/installer/install.php-old • Start Care2x by browsing to: http://localhost/care/ • To install the ICD databases start phpmyadmin: http://localhost/phpmyadmin/ • go on the Care2x db, select the table ICD10_xx (substitute xx by the code more appropriate to your country) and manually import the csv file ICD_10_xx.csv. You'll find the .csv at: <care2x_dir>/installer/db/icd10/ • To change the MySql root password, execute from a Linux terminal: • mysql -u root • UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root'; • FLUSH PRIVILEGES; • EXIT; • See help on changing MySql permissions at: <http://dev.mysql.com/doc/refman/4.1/en/resetting-permissions.html> 5. Various ATENTION: This should be done while OUTSIDE the chroot environment • vi /etc/fstab • /proc /home/dapper/proc none bind 0 0 # Can just be mounted, comments? • /dev /home/dapper/dev none bind 0 0 # Good thing todo, but not secure. • /sys /home/dapper/sys none bind 0 0 # Same as proc? • /tmp /home/dapper/tmp none bind 0 0 # This opens a lot of doors, namly X sockets are here... DRI should work assuming bits match. • /home /home/dapper/home none bind 0 0 # This is (very) optional. • /media /home/dapper/media none bind 0 0 # Your USB Pen Drive. • /lib/modules /home/dapper/lib/modules none bind 0 0 # If needing to load modules (binfmt_misc). • /var/run/dbus/ /home/dapper/var/run/dbus/ none bind 0 0 # Gnome likes this (?). • /media/cdrom0 /home/dapper/media/cdrom none bind 0 0 # optional • proc-chroot /home/dapper/proc proc defaults 0 0 • devpts-chroot /home/dapper/dev/pts devpts defaults 0 0 • sudo mount -a # remount all those entries References: https://wiki.ubuntu.com/DebootstrapChroot ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Care2002-developers mailing list Care2002-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/care2002-developers