Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions docs/config/apache2-site
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@
<VirtualHost *:80> # change from 80 to 443 if you enable SSL
ServerAdmin webmaster@localhost

DocumentRoot /path/to/project/base/www/lorisdb/htdocs/
DocumentRoot %LORISROOT%htdocs/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /path/to/project/base/www/lorisdb/htdocs/>
<Directory %LORISROOT%htdocs/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

php_value include_path .:/usr/share/php:/usr/share/pear:/path/to/lorisdb/php/libraries:/path/to/jpgraph/src
php_value include_path .:/usr/share/php:/usr/share/pear:%LORISROOT%project/libraries:%LORISROOT%php/libraries

ErrorLog /var/log/apache2/PROJECTNAME-error.log
ErrorLog /var/log/apache2/%PROJECTNAME%-error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/PROJECTNAME-access.log combined
CustomLog /var/log/apache2/%PROJECTNAME%-access.log combined
ServerSignature Off

SSLEngine Off # change to On to enable, after updating cert paths below
SSLCertificateFile /etc/apache2/ssl/PROJECT-cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/PROJECT-key.pem
SSLCACertificateFile /etc/apache2/ssl/CA-cacert.pem
#SSLEngine Off # change to On to enable, after updating cert paths below

#SSLCertificateFile /etc/apache2/ssl/%PROJECTNAME%-cert.pem
#SSLCertificateKeyFile /etc/apache2/ssl/%PROJECTNAME%-key.pem
#SSLCACertificateFile /etc/apache2/ssl/CA-cacert.pem

</VirtualHost>
77 changes: 10 additions & 67 deletions docs/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
<!-- file paths -->
<paths>
<imagePath>/PATH/TO/MINC/DATA/ROOT/mri-data/minc/</imagePath>
<base>/PATH/TO/lorisdb/</base>
<base>%LORISROOT%</base>
<data>SAME AS imagePath</data>
<extLibs>/PATH/TO/SMARTY/libs</extLibs>
</paths>

<!-- database settings -->
<database>
<host>HOSTNAME</host>
<username>USERNAME</username>
<password>PASSWORD</password>
<database>DATABASE</database>
<quatUser>USErNAME</quatUser>
<quatPassword>PASSWORD</quatPassword>
<host>%HOSTNAME%</host>
<username>%USERNAME%</username>
<password>%PASSWORD%</password>
<database>%DATABASE%</database>
<quatUser>%USERNAME%</quatUser>
<quatPassword>%PASSWORD%</quatPassword>
<name>Example database</name>
</database>

Expand All @@ -40,7 +40,6 @@
<link url='dicom_archive.php?' args=''>DICOM Archive</link>
<link url='mri_browser.php?' args='MRIBrowser'>MRI Browser</link>
<link url='query_gui.php?' args=''>Data Query GUI</link>
<link url='mri_stats.php?' args=''>Database statistics</link>
</links>

<!-- mail settings -->
Expand Down Expand Up @@ -128,32 +127,15 @@
<!-- end of study definition -->


<multiSiteEnabledCenters>
<a>1</a>
<b>200</b>
</multiSiteEnabledCenters>



<!-- GUI default settings -->
<gui>
<css>main.css</css>
<css>main.css</css>
<rowsPerPage>25</rowsPerPage>
<showTiming>0</showTiming>
<showPearErrors>0</showPearErrors>
<showDatabaseQueries>0</showDatabaseQueries>
<showPearErrors>0</showPearErrors>
<showDatabaseQueries>0</showDatabaseQueries>
</gui>

<mri>
<efax>
<backup_dir></backup_dir>
<new_dir></new_dir>
<assigned_dir></assigned_dir>
<unassigned_dir></unassigned_dir>
</efax>
</mri>


<main_menu_tabs>
<!-- tab name -->
<tab>
Expand All @@ -172,26 +154,6 @@
<permissions></permissions>
<visible>1</visible>
</tab>
<tab>
<link>timepoint_flag</link>
<label>Exclusion</label>
<access>all</access>
<permissions>
<perm>timepoint_flag</perm>
<perm>timepoint_flag_evaluate</perm>
</permissions>
<visible>0</visible>
</tab>
<tab>
<link>mri_safety</link>
<label>MRI Safety Form</label>
<access>all</access>
<permissions>
<perm>data_entry</perm>
<perm>mri_safety</perm>
</permissions>
<visible>0</visible>
</tab>
<tab>
<link>user_accounts</link>
<label>User Accounts</label>
Expand All @@ -201,25 +163,6 @@
</permissions>
<visible>1</visible>
</tab>
<tab>
<link>tracking_logs</link>
<label>Tracking Logs</label>
<access>all</access>
<permissions>
<perm>tracking_logs</perm>
</permissions>
<visible>0</visible>
</tab>
<tab>
<link>certification</link>
<label>Certification</label>
<access>all</access>
<permissions>
<perm>certification</perm>
<perm>certification_multisite</perm>
</permissions>
<visible>0</visible>
</tab>
</main_menu_tabs>

</config>
Expand Down
108 changes: 108 additions & 0 deletions tools/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/sh
# This will:
# 1. Install PEAR libraries
# 2. Set up
# This will only install the database components and Loris config file.
# It will not affect any system

CWD=`pwd`;

if [ ! -f ../SQL/0000-00-00-schema.sql ]; then
echo "Could not find schema file";
exit 1;
fi
if [ ! -d ../project ]; then
mkdir ../project
fi
if [ -f ../project/config.xml ]; then
echo "Loris appears to already be installed. Aborting."
exit 1;
fi


read -p "What is the database name? " mysqldb
read -p "Database host? " mysqlhost
read -p "What MySQL user will Loris connect as? " mysqluser
read -p "What MySQL is $mysqluser's password? " mysqlpass

echo "exit" | mysql $mysqldb -h$mysqlhost -u$mysqluser -p$mysqlpass -A > /dev/null 2>&1

MySQLError=$?;

if [ $MySQLError -eq 0 ]; then
RootDir=`dirname $CWD`;
echo "Creating config file"
sed -e "s/%HOSTNAME%/$mysqlhost/g" -e "s/%USERNAME%/$mysqluser/g" -e "s/%PASSWORD%/$mysqlpass/g" -e "s/%DATABASE%/$mysqldb/g" -e "s#%LORISROOT%#$RootDir/#g" ../docs/config/config.xml > ../project/config.xml

if [ ! -d $RootDir/php/smarty/templates_c ]; then
echo "Creating templates_c"
mkdir $RootDir/php/smarty/templates_c
fi
echo "Fixing permissions on template_c"
chmod 777 $RootDir/php/smarty/templates_c/

echo "Creating database tables"
mysql $mysqldb -h$mysqlhost -u$mysqluser -p$mysqlpass -A >> logs/install-`date +%Y-%m-%d`.log 2>&1 < ../SQL/0000-00-00-schema.sql
read -p "Enter SiteMin user's password (will be echoed to screen, and prompted to reset on login): " lorispass
echo "Updating SiteMin password "
mysql $mysqldb -h$mysqlhost -u$mysqluser -p$mysqlpass -A -e "UPDATE users SET Password_MD5=CONCAT('aa', MD5('aa$lorispass')) WHERE ID=1"

while true; do
read -p "Would you like to install PEAR libraries (affects system files)? [yn] " yn
case $yn in
[Yy]* )
echo "Installing PEAR libraries (may prompt for sudo password)"
sudo pear upgrade-all >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Benchmark >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Config >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install File_Archive >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install HTML_Common >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install HTML_QuickForm >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear config-set preferred_state beta >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install HTML_QuickForm2 >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Mail >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Mail_Mime >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Net_SMTP >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Net_Socket >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install OLE >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Pager >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install PhpDocumentor >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Spreadsheet_Excel_Writer >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install Structures_Graph >> logs/install-`date +%Y-%m-%d`.log 2>&1
sudo pear install XML_Parser >> logs/install-`date +%Y-%m-%d`.log 2>&1
break;;
[Nn]* )
echo "Not installing PEAR libraries"
break;;
* ) echo "Please enter y or n"
esac
done;
while true; do
read -p "Would you like to automatically create/install apache config files? [yn] " yn
case $yn in
[Yy]* )
read -p "Enter project name (no spaces): " projectname
if [ -f /etc/apache2/sites-available/$projectname ]; then
echo "Apache appears to already be configured for $projectname. Aborting\n"
exit 1
fi;

# Need to pipe to sudo tee because > is done as the logged in user, even if run through sudo
sed -e "s#%LORISROOT%#$RootDir/#g" -e "s#%PROJECTNAME%#$projectname#g" ../docs/config/apache2-site | sudo tee /etc/apache2/sites-available/$projectname > /dev/null
#sudo a2dissite default
#sudo a2ensite $projectname
break;;
[Nn]* )
echo "Not configuring apache"
break;;
* ) echo "Please enter y or n"
esac
done;


echo "Installation complete."
echo "Must updated cli/php.ini if any command line scripts are to be used."
else
echo "Could not connect to database with user provided";
exit 1;
fi;