FreeMED Installation Instructions on Debian Linux
These instructions were kindly contributed by Jeffrey Buchbinder, the principal architect and developer of FreeMED.
# Debian install instructions; must be root or sudo -s to do this
#
# If you need to ask "why sudo", you should get and install it right now.
# Get basic FreeMED dependencies
apt-get -y install subversion mysql-server-4.1 php4-mysql apache2 \
libapache2-mod-php4 libxml-parser-perl libtext-iconv-perl \
djvulibre-bin netpbm imagemagick tetex-bin tetex-extra \
cupsys cupsys-client gs-common php4-cgi xpdf-utils
cd /usr/share/
svn co http://svn.freemedsoftware.org/freemed/branches/0.8.x freemed
svn co http://svn.freemedsoftware.org/remitt/trunk remitt
chown -Rf www-data:www-data freemed
# Remove the AddModule line from /etc/apache2/conf.d/freemed.apache.conf
/etc/init.d/apache2 restart
# Get remitt dependencies and install
apt-get -y install $(cat /usr/share/remitt/debian/control | grep ^Depends | awk -F'},' '{ print $2; }' | sed -e 's/,/ /g;')
cd /etc/init.d/
ln -s /usr/share/remitt/debian/init.d remitt )
update-rc.d remitt defaults
#Then:
/etc/init.d/remitt start
# You should see Starting REMITT Medical Billing Service: remitt.
cd /usr/share/remitt
./bin/sqlite_user_admin.pl create remitt_username remitt_password
# It's pretty arbitrary. Just make a username and password, then enter the same one in FreeMED under REMITT in System Configuration.
# Then configure inside FreeMED to be able to use the remitt server.
#then as a regular user (not root) type
mysql -uroot
#When you get to the prompt, type:
GRANT ALL ON freemed.* TO arbitrary_user_name@localhost IDENTIFIED BY 'your_database_password';
#Do not remove the 'and ' and the ; in the previous sentence
# Then type:
FLUSH PRIVILEGES;
#Don't forget the semicolon
#you should see:
#Query OK, 0 rows affected (0.03 sec) or something like it
#now type:
EXIT
# Now configure FreeMED to use those
cd /usr/share/freemed
vi lib/settings.php
#change define ('DB_USER', "root"); to define ('DB_USER', "user you set in GRANT");
#and:
#change define ('DB_PASSWORD', ""); to ('DB_PASSWORD', "password you set in GRANT");
#Then go to http://localhost/freemed and enter the mysql password and choose the FreeMED admin password and verify it.
#That should do it






Hello. This is my first post here. I came across FreeMED while looking for a solution for a client. I've been fighting with the installation process for a couple of weeks, on and off, while trying to get FreeMED installed so that I could learn the software and come up with a demo. On my fourth computer, it worked, but I couldn't reproduce it. I must have tried the install six or seven times yesterday.
Finally, after I got mine to work on a Toshiba laptop running Kubuntu 6.10 (Edgy Eft), I decided to document how I did it, using the original post above as well (these instructions are a bit of a hybrid). I then used that doc to install FreeMED on my little home server, a Dell running Debian GNU/Linux testing (etch), successfully. Thus, I feel I must have something worth sharing.
It's likely that I've done things in a way that could be done a lot better or easier. I'm kind of an "intermediate" Linux user, mostly self-taught, so please feel free to point out anything that could have been done better.
# Possible installation instructions for a successful FreeMed install
# on Kubuntu/Ubuntu 6.10 and Debian Etch
# Download the .deb package for FreeMED and REMITT. At the time of
# this writing, those packages were called "freemed_0.8.3-1_all.deb"
# and "remitt_0.3.2-1_all.deb".
# This was tested with Kubuntu 6.10 and Debian GNU/Linux testing (etch).
# If you are using either of these and some of the packages fail to load,
# open up more repositories in your /etc/apt/sources.list
# As root (or sudo -s), and from the folder containing this document:
apt-get -y install apache2 cron cupsys cupsys-client djvulibre-bin \
gs-common imagemagick libpdf-api2-perl libapache2-mod-php4 \
libtext-iconv-perl libxml-parser-perl libxml-simple-perl mysql-client \
mysql-server netpbm pdfjam perl php4 php4-cgi php4-cli php4-curl \
php4-domxml php4-gd php4-mysql tetex-bin tetex-extra xpdf-utils
# Use dpkg to install REMITT
dpkg +i remitt_0.3.2-1_all.deb
# The .deb for REMITT seems to create things differently than I think
# are appropriate for startup...or at least different from what I have
# been seeing, so this next line just makes a symbolic link to kind of
# make it work either way:
ln -s /etc/init.d/remitt.dpkg-new /etc/init.d/remitt
# This insures that REMITT is going to start up on reboot
update-rc.d remitt defaults
# And this starts REMITT
/etc/init.d/remitt start
# You should see "Starting REMITT Medical Billing Service: remitt."
# Choose a username and password for REMITT by replacing "username" and
#"password" in the command below. After you've successfully connected
# to the Freemed system (after the entire installation is completed),
# enter the same username and password that you choose here under "REMITT"
# in "System Configuration."
/usr/share/remitt/bin/sqlite_user_admin.pl create username password
# This next command basically deflates the .deb file to the root directory,
# putting the Freemed files and Apache configuration where they belong.
# I have no idea if this is a "best practice," but it worked for me.
dpkg -X freemed_0.8.3-1_all.deb /
# This modified "postinst" file was extracted from the developer's original
# .deb package (the one you just inflated above), but it had errors. I
# fixed the errors, but I don't know how to build a .deb package, so I just
# pulled it out and I ran it by saving it as an executable file called
# "postinst", then ran it with ./postinst. (My changes are noted, FYI.):
# ***Begin modified postinst file ***
#! /bin/sh -e
# $Id: postinst 2180 2005-09-01 00:40:54Z jeff $
# $Author: jeff $
#
# Post-install directives for FreeMED package
# Patch PHP ini file to have more than 8M per process
# ***The following two "if/then" lines were changed from "if/do" by Kevin McDonald, 01-26-2007
if [ -f /etc/php4/apache/php.ini ]; then
perl -pi -e "s|8M|64M|;" /etc/php4/apache/php.ini
fi
if [ -f /etc/php4/apache2/php.ini ]; then
perl -pi -e "s|8M|64M|;" /etc/php4/apache2/php.ini
fi
# Apache user has to own freemed
echo -n "Updating ownership of freemed to webserver user ... "
chown -Rf www-data.www-data /usr/share/freemed
echo "[done]"
# Change writeable permissions for data/, img/store, etc
echo -n "Updating permissions ... "
# ***The following two chmod lines were changed by Kevin McDonald, 01-26-2007
chmod -Rf a+w /usr/share/freemed/data/cache
chmod -Rf a+w /usr/share/freemed/data/backup
echo "[done]"
# Attempt to create freemed mysql database ... will have no password if
# it has just been installed. Do not run if there is already a freemed
# version installed.
if [ ! -d /var/lib/mysql/freemed ]; then \
echo "Attempting to create freemed database (enter password, or enter if none) ... "; \
mysqladmin -u root -p create freemed 2>&1; \
echo "[done]"; \
fi
# Restart apache ...
echo "Restarting apache to reload configuration files ... "
if [ -f /etc/init.d/apache ]; then \
/etc/init.d/apache restart; \
fi
if [ -f /etc/init.d/apache-ssl ]; then \
/etc/init.d/apache-ssl restart; \
fi
if [ -f /etc/init.d/apache2 ]; then \
/etc/init.d/apache2 restart; \
fi
exit 0
# ***End modified postinst file***
# From a web browser on the server itself, go to http://127.0.0.1/freemed
# You can also usually use http://localhost/freemed, but that actually
# messed up on me once but the IP worked. Go figure.
# Enter "root" as the user and leave the password blank. In the next two
# blanks, choose a FreeMED admin password and verify it. It should confirm
# that you have set up the adminitrative user.
# Continue, then log in with the username "admin" and the administrative
# password you chose. If all went well, you just got logged in.