script to install and configure cvs demo
[openemr.git] / INSTALL
blob11ad7f23201b205adc0ca55f776a87cc0846ffa4
1 Installation Instructions
2 -------------------------------------
4 OSI Certified Open Source Software
6 -------------------------------------
8 I...................Overview of Directories
9 II..................Unpacking
10 III.................Setup
11 IV..................Setting up Access Control
12 V...................Upgrading
14 -------------------------------------
16 I. Overview of Directories
18 accounting    - Contains information and scripts to support SQL-Ledger
19 contrib       - Contains many user-contributed encounter forms and utilities
20 custom        - Contains scripts and other text files commonly customized
21 Documentation - Contains useful documentation
22 interface     - Contains User Interface scripts and configuration
23 library       - Contains scripts commonly included in other scripts
24 sql           - Contains initial database images
25 gacl          - Contains embedded php-GACL (access controls)
27 II. Unpacking
29 The OpenEMR release archive should be named as follows:
31 openemr-<version>.tar.gz  -or-  openemr-<version>.zip
33 To extract the archive, use either of the following commands from the command line:
35 bash# tar -pxvzf openemr-<version>-release.tar.gz
36 bash# unzip openemr-<version>-release.tar.gz
38 Be sure to use the -p flag when using tar, as certain permissions must be preserved.
40 OpenEMR will be extracted into a directory named openemr.
42 Alternatively a Debian package may be available as a file named
43 openemr-<version>.deb.  This may work with some other Debian-like
44 Linux distributions such as Ubuntu.
46 III. Setup
48 To run OpenEMR, MySQL and Apache or another PHP-capable webserver must be configured.
49 To download Apache, visit www.apache.org
50 For information on how to install MySQL, visit www.mysql.com
51 PHP may be downloaded from www.php.net
53 OpenEMR requires a number of webserver and PHP features which may not be
54 enabled on your system.  These include:
56 - PHP Index support (ensure that index.php is in your Index path in httpd.conf)
57 - Session variables
58 - PHP libcurl support (optional for operation, mandatory for billing)
60 Copy the OpenEMR folder into the root folder of the webserver. On Mandrake
61 Linux, for example, use the command:
63   bash# mv openemr /var/www/html/
65 Make sure the webserver is running, and point a web-browser to setup.php located
66 within the openemr web folder.  If you installed OpenEMR in the root web
67 directory, the URL would read: http://localhost/openemr/setup.php.
68 The setup script will step you through the configuration of the OpenEMR.
70 The first screen of the setup script will ensure that the webserver user
71 (in linux, often is "apache", "www-data", or "nobody") has write privileges on
72 certain files and directories.  The files include openemr/interface/globals.php,
73 openemr/library/sqlconf.php, openemr/gacl/gacl.ini.php and
74 openemr/gacl/gacl.class.php.  In linux, these can be set by "chmod a+w filename"
75 command to grant global write permissions to the file, but be sure to set
76 them back to something more secure (such as chmod 644) after completing
77 installation of OpenEMR.  The directories include openemr/gacl/admin/templates_c,
78 openemr/edi, openemr/documents, 
79 openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled and
80 openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache.  In
81 linux, if the webserver user name is "apache", then the command
82 "chown -R apache:apache directory_name" will grant global write permissions
83 to the directories, and we recommend making these changes permanent.
84 Should the page display errors related to file or directory writing priviledges you 
85 may click the 'Check Again' button to try again (after fixing permissions).
87 In step 1, you need to tell setup whether it needs to create the database on
88 its own, or if you have already created the database.  MySQL root priveleges will
89 be required to create a database.
91 In step 2, you will be presented with a number of fields which specify the MySQL
92 server details and the openemr directory paths.
94 The "Server Host" field is the hostname of the MySQL server.  If you use the
95 mysql command line client, this is the string you would type after the -h flag.
96 If this is on the same machine as the webserver, leave this as "localhost".
98 The "Server Port" field specifies the port to use when connecting to the MySQL
99 server over TCP/IP.  This should be left as 3306 unless you changed it in your
100 MySQL configuration.
102 The "Database Name" field is the database where OpenEMR will reside.  If you
103 selected to have the database created for you, this database will be created,
104 along with the user specified in "Login Name".  If this database exists, setup
105 will not be able to create it, and will return an error.  If you selected that
106 you have already created the database, then setup will use the information you
107 provide to connect to the MySQL server.  Note that setup will not accept a
108 password that is not at least one (1) character in length.
110 The "Login Name" field is the MySQL user that will access the OpenEMR database.
111 If you selected to have the database created for you, this user will be
112 created.  If you selected that you have already created the database, 
113 then setup will use the information you provide to connect to the MySQL server.
115 The "Password" field is the password of the user entered into the above
116 "Login Name" field.  If you selected to have the database created for you,
117 this user and password  will be created.  If you selected that you have already
118 created the database, then setup will use the information you provide to connect
119 to the MySQL server.
121 The "Name for Root Account" field will only appear if setup is creating the
122 database.  It is the name of the MySQL root account. For localhost, it is
123 usually ok to leave it 'root'.
125 The "Root Pass" field will likewise only appear if setup is creating the
126 database.  It is the password of your existing root user, and is used to acquire
127 the privileges to create the new database and user.
129 The "User Hostname" field will also only appear if setup is creating the 
130 database.  It is the hostname of the Apache/PHP server from which the user
131 ("Login Name") is permitted to connect to the MySQL database.  If you are setting
132 up MySQL and Apache/PHP on the same computer, then you can use 'localhost'.  
134 The "Initial User" is the username of the first user, which is what they will
135 use to login.  Limit this to one word only.  Their default password will
136 always be "pass", without the quotes.
138 The "Initial User's Name" is the value to be used as their last name.  This
139 information may be changed in the user administration page.
141 The "Initial Group" is the first group, basically name of the practice, that
142 will be created.  A user may belong to multiple groups, which again, can be
143 altered on the user administration page. It is suggested that no more than
144 one group per office be used.
146 The "Absolute Path" is the full absolute directory path to openemr.  The
147 default value is automatically created, so this should not need to be
148 modified.  Note that it needs to end without a trailing slash.  To avoid
149 confusion, either forward or backward slashes can be used.
151 The "Relative HTML Path" is the relative html path to openemr, ie. what you
152 would type into the web browser after the server address to get to OpenEMR.
153 For example, if you type "http://127.0.0.1/clinic/openemr/"  to load OpenEMR,
154 set this to "/clinic/openemr" without the trailing slash.  To avoid
155 confusion, either forward or backward slashes can be used.
157 Step 3 is where setup will configure OpenEMR.  It will first create the database
158 and connect to it to create the initial tables.  It will then write the mysql
159 database configuration to a file.  It will then write the webserver root
160 directory to the /openemr/interface/globals.php file.  Should anything fail
161 during step 3, you may have to remove the existing database or tables before
162 you can try again. If no errors occur, you will see a "Continue" button at the bottom.
164 Step 4 will install and configure the embedded phpGACL access controls.  It
165 will first write configuration settings to files.  It will then configure the
166 database.  It will then give the "Initial User" administrator access.
167 Should anything fail during step 4, you may have to remove the existing database
168 or tables before you can try again. If no errors occur, you will see a
169 "Continue" button at the bottom.
171 Step 5 give instructions on configuring the PHP and Apache webserver.  We
172 suggest you print these instructions for future reference.
174 Regarding the PHP configuration in step 5, instructions are given to edit
175 the php.ini configuration file.  If possible, the location of your php.ini file
176 will be displayed in green.  If your php.ini file location is not displayed,
177 then you will need to search for it.  The location of the php.ini file is dependent
178 on the operating system.  In linux, php.ini is generally found in the /etc/
179 directory.  In windows, the XAMPP 1.7.0 package places the php.ini file in
180 the xampp\apache\bin\ directory.  To ensure proper functioning of OpenEMR
181 you must make sure that settings in the php.ini file include "display_errors =
182 Off", "register_globals = Off", "magic_quotes_gpc = Off", and "memory_limit"
183 set to at least "128M".  In order to take full advantage of the patient
184 documents capability you must make sure that settings in php.ini file
185 include "file_uploads = On", that "upload_max_filesize" is appropriate for
186 your use and that "upload_tmp_dir" is set to a correct value that will work
187 on your system.
189 Regarding the Apache configuration in step 5, instructions are given to secure
190 the "openemrwebroot/documents" and "openemrwebroot/edi" directories, which
191 contain patient information. This can be done be either placing pertinent
192 .htaccess fiels in these directories or by editing the apache configuration
193 file.  The location of the apache configuration file is dependent on the
194 operating system.  In linux, you can type 'httpd -V' on the commandline;
195 the location to the configuration file will be the HTTPD_ROOT variable plus
196 the SERVER_CONFIG_FILE variable.  In windows, the XAMPP 1.7.0 package places
197 the configuration file at xampp\apache\conf\httpd.conf.  To secure the
198 /documents and /edi directories you can paste following to the end of the
199 apache configuration file (ensure you put full path to directories):
200 <Directory "openemrwebroot/documents">
201 order deny,allow
202 Deny from all
203 </Directory>
204 <Directory "openemrwebroot/edi">
205 order deny,allow
206 Deny from all
207 </Directory>
209 At bottom of step 5, you will see a "Continue" button at the bottom.
211 The final screen includes some additional instructions and important
212 information. We suggest you print these instructions for future reference.
213 It would be a good idea to restore secure permissions on the four
214 configuration files: interface/globals.php, library/sqlconf.php, 
215 gacl/gacl.ini.php, and gacl/gacl.class.php files. In linux, recommend changing 
216 these file permissions with the 'chmod 644 filename' command.
218 Once the system has been configured properly, you may login.  Connect to the
219 webserver where the files are stored with your web browser.  Login to the system
220 using the username that you picked (default 'admin' without quotes), and the
221 password 'pass', without the quotes.  From there, select the "Administration"
222 option, and customize the system to your needs.  Add users and groups as is
223 needed. For information on using OpenEMR, consult the User Documentation located
224 in the Documentation folder, the wiki at http://www.oemr.org, and the forums
225 at http://sourceforge.net/projects/openemr.
227 Reading openemr/includes/config.php and openemr/interface/globals.php is a
228 good idea. These files contain many options to choose from including themes.
230 To create custom encounter forms, see the files
232   openemr/Documentation/3rd Party Form API.txt
233   openemr/interface/forms/OpenEMR_form_example-rev2.tar.gz
235 and read the included documentation. Many forms exist in contrib/forms as well
236 as in interface/forms and may be used as examples.
238 Other configuration settings are stored under includes/config.php.
239 Everything should work out of the installation without touching those, but if 
240 you want fax, sql-ledger, and/or Freeb integration you will need to adjust some
241 parameters in that file.
243 General-purpose fax support requires customization of interface/globals.php
244 and custom/faxcover.txt; it also requires the following utilities:
246 * faxstat and sendfax from the HylaFAX client package
247 * mogrify from the ImageMagick package
248 * tiff2pdf, tiffcp and tiffsplit from the libtiff-tools package
249 * enscript
252 IV. Setting Up Access Control
254 Since OpenEMR version 2.9.0.3, phpGACL access controls are installed and
255 configured automatically during OpenEMR setup.  It can be administered
256 within OpenEMR in the admin->acl menu.  This is very powerful
257 access control software.  To learn more about phpGACL
258 (see http://phpgacl.sourceforge.net/), recommend reading the phpGACL manual,
259 the /openemr/Documentation/README.phpgacl file, and the online wiki at
260 www.oemr.org. Also recommend reading the comments in /openemr/library/acl.inc.
262 V. Upgrading
264 Be sure to back up your OpenEMR installation and database before upgrading!
266 Upgrading OpenEMR is currently done by replacing the old openemr directory with
267 a newer version. Before replacing the old openemr directory, copy the following
268 files out, and replace them into the new openemr folder afterwards:
270   openemr/interface/globals.php
271   openemr/library/sqlconf.php
272   openemr/includes/config.php (if you have modified it)
274 But before replacing them, compare the old and new files in case there are
275 new parameters that need to be included.  If there are other files that you
276 have customized, then you will also need to treat those carefully.
278 To upgrade the database, run the sql_upgrade.php script from your web
279 browser (for example http://openemr.location/sql_upgrade.php).  It will
280 prompt you to select the old release number, and will display the SQL
281 commands issued as the upgrade occurs.
283 Next, if you are converting from SQL-Ledger to OpenEMR's internal A/R
284 management (normally you should), run the sl_convert.php script
285 (e.g. http://openemr.location/sl_convert.php).  Note this script may
286 run for several minutes or longer.
288 If phpGACL is installed (automatically installed since OpenEMR version 2.9.0.3),
289 then you should upgrade your Access Controls by running the acl_upgrade.php
290 program using your web browser (e.g. http://openemr.location/acl_upgrade.php).