Amazon Linux 4.2.2 Script

jesdynf wrote on Saturday, November 26, 2016:

Hello,

I had a little more trouble setting OpenEMR up than I thought I should’ve – it was my first PHP project, and it wasn’t immediately obvious to me that I’d failed to install certain PHP modules. (And the grief I got from my VirtualBox CentOS hiding MySQL under MariaDB is a little embarassing, too, but that was local and not AWS.)

Attached you can find a full, tested, perfect “script” for installing OpenEMR 4.2.2 on the current release of Amazon Linux. I’d attach it to the wiki but I don’t have an account.

Hope it’s useful!

# pseudo-script for OpenEMR install on Amazon Linux
# some bits are interactive, sorry
sudo bash
cd
yum update -y
yum install httpd24 mysql-server php70 php70-mysqlnd php70-mbstring -y
wget -O openemr-4.2.2.tar.gz http://sourceforge.net/projects/openemr/files/OpenEMR%20Current/4.2.2/openemr-4.2.2.tar.gz/download
tar -pzxvf openemr-4.2.2.tar.gz
chown -R root:root openemr-4.2.2
mv openemr-4.2.2 /var/www/html/openemr
service mysqld start
chkconfig --level 2345 mysqld on

# interactive steps 
mysql_secure_installation
# root password is blank, set a new root password, delete temp DBs and anonymous users, reload tables
nano /etc/php.ini
#   add "register_globals = Off"
#   change max_execution_time to 60 (from 30)
#   change max_input_time to 90 (from 60)
#   change post_max_size to 30M (from 8M)
nano /etc/httpd/conf.d/openemr.conf
# --- add the following section
  <Directory "/var/www/html/openemr">
      AllowOverride FileInfo
  </Directory>
  <Directory "/var/www/html/openemr/sites">
      AllowOverride None
  </Directory>
  <Directory "/var/www/html/openemr/sites/*/documents">
      order deny,allow
      Deny from all
  </Directory>
  <Directory "/var/www/html/openemr/sites/*/edi">
      order deny,allow
      Deny from all
  </Directory>
  <Directory "/var/www/html/openemr/sites/*/era">
      order deny,allow
      Deny from all
  </Directory>
# section ends ---

service httpd start
chkconfig --level 2345 httpd on

# begin setup process, browse to http://[remoteip]/openemr
# step 1, continue
# step 2, allow setup to create DB
# step 2 continued, fill in all empty blanks
#   "Password": password for MySQL user OpenEMR /is about to create/ for its own use
#   "Root pass": MySQL root user password you set during mysql_secure_installation step
#   "Initial User Password": Master OpenEMR administrative password, can change later
# step 3, continue
# step 4, continue
# step 5, continue
# step 6, continue
# you may follow link and log in, username "admin", password your initial user password
  
# post-install cleanup
cd /var/www/html
chmod 644 openemr/library/sqlconf.php
chmod 600 openemr/acl_setup.php
chmod 600 openemr/acl_upgrade.php
# docs say it should be there but it isn't?
#chmod 600 openemr/sl_convert.php
chmod 600 openemr/setup.php
chmod 600 openemr/sql_upgrade.php
chmod 600 openemr/gacl/setup.php
chmod 600 openemr/ippf_upgrade.php

matthewvita wrote on Sunday, November 27, 2016:

Asher,

A group of my friends decided to start an open source development group and our next project is writing scripts to host OpenEMR on AWS:* “A project that will demonstrate how a small facility or large hospital system can run their OpenEMR installation in the cloud via AWS Elastic Beanstalk, AWS RDS, AWS VPC, and other essential services. AWS cloud will provide a highly scalable, deeply secure, and cost-effective choice for many global OpenEMR users.”*

It’s the next project in our queue! I will be sure to use your script as a guide! I will link it on the OpenEMR wiki once it passes a code review, of course.

Thanks,
Matthew Vita

jesdynf wrote on Sunday, November 27, 2016:

Matthew,

AWS and e-commerce is pretty much my bread and butter. I’d be delighted to help with a project like that one – I’ll follow up over there. The next step for a setup like this would be to either fully automate setup (via Chef recipe or something similar, plus a suitable SQL dump) or make a golden master appliance, but I noticed the wiki said there’s not currently a 4.2.2 appliance available and I figure with 5.0.0 so close it’s probably not the best time to dig into it.

Thanks!

visolveemr wrote on Tuesday, November 29, 2016:

Hello Asher,

ViSolve is the Vice-Chair of OEMR Board and has made significant technical contributions to OpenEMR. Additionally, ViSolve has decades of experience working with enterprise customers providing a range of Systems [Enterprise IT] Services. Leveraging on this expertise, ViSolve provides services including Hosting and Support of OpenEMR in Cloud (AWS). Other services include: Migration, High Availablity & Disaster Recovery, Performance /Scalability and Security.

ViSolve has already created the following Technical Guides and posted in Source Forge earlier. For your benefit, please find the link to download these from our website resources section: http://hc.visolve.com/#vi-resources

· Hardening OpenEMR in Cloud (AWS)

· Deploying OpenEMR with multiple instance in Cloud (AWS)

· High Availability of OpenEMR in Cloud (AWS)

In addition to this, ViSolve is also working on a Technical Document/Paper titled “ How to secure DATA at REST in Cloud (AWS) which we believe would be extremely vital and useful.

Thanks,

ViSolve OpenEMR Support Team
Email: services@visolve.com
Phone: 408 850 2243

cmswest wrote on Wednesday, November 30, 2016:

many, many, many thanks to Visolve! (it’s the OEMR board, http://www.oemr.org/about/board-members/ that Sena vice-chairs)

visolveemr wrote on Wednesday, November 30, 2016:

Thanks much Stephen. Also, as you rightly mentioned ViSolve (Sena) vice-chairs the OEMR Board. Corrected the typo in the earlier post. Thanks once again.

jesdynf wrote on Friday, December 02, 2016:

Thanks! I’ll take a look at those too.