3 #This program is free software; you can redistribute it and/or modify
4 #it under the terms of the GNU General Public License as published by
5 #the Free Software Foundation; either version 2 of the License, or
6 #(at your option) any later version.
9 # email brady@sparmy.com
13 #This script is called by the the OpenEMR CVS demo and developer appliance.
14 # It configures the CVS Demo and the Developer Appliance
15 # It will configure OpenEMR (bypassing setup.php).
22 LOG
=$WEB/log
/logSetup.txt
24 TMPDIR
=/tmp
/openemr-tmp
26 # PATH OF INSTALL SCRIPT
27 INST
=$OPENEMR/contrib
/util
/installScripts
/InstallerAuto.php
28 INSTTEMP
=$OPENEMR/contrib
/util
/installScripts
/InstallerAutoTemp.php
30 #INSTALL AND CONFIGURE OPENEMR
31 echo "Configuring OpenEMR"
32 echo "Configuring OpenEMR" >> $LOG
34 # Set file and directory permissions
35 chmod 666 $OPENEMR/sites
/default
/sqlconf.php
36 chown
-R apache
:apache
$OPENEMR/sites
/default
/documents
37 chown
-R apache
:apache
$OPENEMR/sites
/default
/edi
38 chown
-R apache
:apache
$OPENEMR/sites
/default
/era
39 chown
-R apache
:apache
$OPENEMR/library
/freeb
40 chown
-R apache
:apache
$OPENEMR/sites
/default
/letter_templates
41 chown
-R apache
:apache
$OPENEMR/interface
/main
/calendar
/modules
/PostCalendar
/pntemplates
/cache
42 chown
-R apache
:apache
$OPENEMR/interface
/main
/calendar
/modules
/PostCalendar
/pntemplates
/compiled
43 chown
-R apache
:apache
$OPENEMR/gacl
/admin
/templates_c
45 # Run installer class for the demo (note to avoid malicious use, script is activated by removing an exit command,
46 # and the active script is then removed after completion.
47 sed -e 's@^exit;@ @' <$INST >$INSTTEMP
48 php
-f $INSTTEMP >> $LOG
51 #reinstitute file permissions
52 chmod 644 $OPENEMR/sites
/default
/sqlconf.php
53 echo "Done configuring OpenEMR"
54 echo "Done configuring OpenEMR" >> $LOG
56 #NOW DEAL WITH STUFF SPECIFIC TO THE CVS DEMO AND DEVELOPER APPLIANCE
58 #Connect to a new mandriva package repository (official repository no longer supports mandriva 2008)
59 echo "Updating new Mandriva Package repository. This is a 100MB download, so may take several minutes."
60 echo "Updating new Mandriva Package repository. This is a 100MB download, so may take several minutes." >> $LOG
61 urpmi.addmedia main http
://ftp.ussg.iu.edu
/linux
/mandrake
/official
/2008.0/i586
/media
/main
/release with media_info
/hdlist.cz
62 urpmi.addmedia
--update main_updates http
://ftp.ussg.iu.edu
/linux
/mandrake
/official
/2008.0/i586
/media
/main
/updates with media_info
/hdlist.cz
63 urpmi.addmedia contrib http
://ftp.ussg.iu.edu
/linux
/mandrake
/official
/2008.0/i586
/media
/contrib
/release with media_info
/hdlist.cz
64 urpmi.addmedia
--update contrib_updates http
://ftp.ussg.iu.edu
/linux
/mandrake
/official
/2008.0/i586
/media
/contrib
/updates with media_info
/hdlist.cz
66 #Install php-gd (graphics), php-mbstring (multibyte character support), php-zip, php-xsl and perl-CGI packages
67 # and restart apache (done after below suhosin patch).
68 echo "Installing gd(graphics) and mbstring(multibyte support) and zip php packages and xsl php package and perl-CGI package..."
69 echo "Installing gd(graphics) and mbstring(multibyte support) and zip php packages and xsl php package and perl-CGI package..." >> $LOG
70 urpmi
--auto php-gd php-mbstring php-zip php-xsl perl-CGI
patch git-core
>> $LOG
72 #Patch the suhosin bug
73 SUHOSINCONF
=/etc
/php.d
/Z98_suhosin.ini
74 echo "Disabling suhosin patch which is not compatible with OpenEMR"
75 echo "Disabling suhosin patch which is not compatible with OpenEMR" >> $LOG
76 echo " In /etc/php.d/Z98_suhosin.ini file commenting out:"
77 echo " In /etc/php.d/Z98_suhosin.ini file commenting out:" >> $LOG
78 echo " extension = suhosin.so"
79 echo " extension = suhosin.so" >> $LOG
80 echo " Then will restart apache."
81 echo " Then will restart apache." >> $LOG
83 sed -i 's/^extension = suhosin.so/; extension = suhosin.so/' $SUHOSINCONF
87 #Replace manual with newest version from cvs
88 echo "Configuring appliance"
89 echo "Configuring appliance" >> $LOG
90 cp -f $OPENEMR/contrib
/util
/installScripts
/cvsDemoMisc
/developerApplianceManual.txt
/home
/openemr
/docs
/manual.txt
91 chown openemr
:openemr
/home
/openemr
/docs
/manual.txt
92 cp -f $OPENEMR/contrib
/util
/installScripts
/cvsDemoMisc
/developerApplianceManual.txt
$WEB/manual.txt
93 echo "Done configuring appliance"
94 echo "Done configuring appliance" >> $LOG
96 #Package the cvs version into a tarball and zip file to be available thru web browser
97 # This is basically to allow download of most recent cvs version from the cvs Demo appliance
98 # It will also ease transfer/testing openemr on windows systems when using the Developer appliance
99 echo "Creating OpenEMR CVS packages"
100 echo "Creating OpenEMR CVS packages" >> $LOG
102 # Prepare the cvs package
104 cp -rf $CVS/openemr
$TMPDIR/
105 rm -rf `find $TMPDIR -name CVS`
106 chmod a
+w
$TMPDIR/openemr
/sites
/default
/sqlconf.php
107 chmod -R a
+w
$TMPDIR/openemr
/sites
/default
/documents
108 chmod -R a
+w
$TMPDIR/openemr
/sites
/default
/edi
109 chmod -R a
+w
$TMPDIR/openemr
/sites
/default
/era
110 chmod -R a
+w
$TMPDIR/openemr
/library
/freeb
111 chmod -R a
+w
$TMPDIR/openemr
/sites
/default
/letter_templates
112 chmod -R a
+w
$TMPDIR/openemr
/interface
/main
/calendar
/modules
/PostCalendar
/pntemplates
/cache
113 chmod -R a
+w
$TMPDIR/openemr
/interface
/main
/calendar
/modules
/PostCalendar
/pntemplates
/compiled
114 chmod -R a
+w
$TMPDIR/openemr
/gacl
/admin
/templates_c
116 # Create the web file directory
119 # Save the tar.gz cvs package
121 tar -czf $WEB/files
/openemr-cvs.
tar.gz openemr
123 md5sum openemr-cvs.
tar.gz
> openemr-linux-md5.txt
125 # Save the .zip cvs package
127 zip -rq $WEB/files
/openemr-cvs.
zip openemr
129 md5sum openemr-cvs.
zip > openemr-windows-md5.txt
131 # Create the time stamp
136 echo "Done creating OpenEMR CVS packages"
137 echo "Done creating OpenEMR CVS packages" >> $LOG