OpenMRS Atlas Module lets implementations create and manage their bubble on the OpenMRS Atlas For instructions on how to use the module, see the Atlas Module wiki page.
Altas Server 2.0 has been refactored with Laravel PHP Framework.
#Installation
- Apache2
- Mysql
- PHP >= 5.4, php5-mcypt, php5-mysql
- url rewriting and mod_rewrite enabled on apache
- PhantomJS >= 1.9.7 (require : libicu48, fontconfig, mscorefont)
- Composer
Mcrypt extension and mod-rewrite module are required mysql driver for php may be required
# Install mcrypt and mysql php ext (if needed)
sudo apt-get install php5-mcrypt php5-mysql
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
sudo php5enmod mcrypt
edit /etc/php5/apache2/php.ini and add extension=mcrypt.so
# Activate mod_rewrite (if needed)
sudo a2enmod rewrite
# Configure Virtual Host
# DocumentRoot to public/ folder
# and AllowOverride All directive
DocumentRoot /opt/atlas/public
<Directory /opt/atlas/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# Restart Aapche
sudo service apache2 restart
# Clone the repo
git clone https://github.com/openmrs/openmrs-contrib-atlas.git /opt/atlas
cd /opt/atlas
# Install vendors and dependencies
composer install
# If Composer is not in PATH
curl -sS https://getcomposer.org/installer | php
php composer.phar install
- Add writting rights to app/storage (www-data for Apache)
sudo chown -R www-data:www-data app/storage
sudo chmod -R ug+rw app/storage
-
Rename
env.local.php
to.env.prod.php
and edit it with your own configuration (database, site_url, phantomJS bin, openmrs id secret). -
Set correct prod hostame in
bootstrap/start.php
-⚠️ It should be the same value ashostname
UNIX command.
$env = $app->detectEnvironment(array(
'local' => array('dev_host'),
'prod' => array('prod_hostame'),
));
- Set correct server Timezone in .env.prod.php (ie. America/New_York)
'TIMEZONE' => 'America/New_York',
- Set correct mysql server charset and collation in .env.prod.php (ie. latin1 & latin1_swedish_ci)
# To show the correct value:
mysql> SHOW VARIABLES LIKE 'character\_set\_%';
# Download latest phantomJS tarbal
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
tar -xvf phantomjs-1.9.7-linux-x86_64.tar.bz2
sudo cp phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/
sudo chmod a+x /usr/bin/phantomjs
# Install libicu48 and fonts
sudo apt-get install libicu48
sudo apt-get install fontconfig freetype
sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
sudo apt-get install ttf-mscorefonts-installer
# add PhantomJS path in .env.prod.php
crontab -u www-data -e
#And add this line to end of file:
*/8 * * * * /usr/bin/php /var/www/openmrs-contrib-atlas/artisan screen-capture
- Seed atlas database with sql dump
- Sync with latest schema using Laravel CLI -
⚠️ rw required to storage/
cd /opt/atlas
# User that executes artisan command should has writing rights to storage/ folder
su www-data
php artisan migrate
php artisan screen-capture --force
Let's started !
public/
: images, css, and js filesapp/views/
: blade template and viewsapp/controllers/
: controllersapp/storage/
: logs, sessions, ...app/routes.php
: routing configapp/filters.php
: routing filters