Documentation/3.2.2/User/Setup/Installation

From MIDAS Wiki

Jump to: navigation, search

Installation

This tutorial was written for Ubuntu 11.04 (Natty Narwhal) but should work with most recent versions of Ubuntu. The system used for generating this document had the following applications installed:

  • Apache version 2.2
  • MySQL version 5.1
  • ImageMagick version 6.6
  • PHP 5.3

Server Preparation

  • Install Imagemagick:
 sudo apt-get install imagemagick
  • Install apache2:
 sudo apt-get install apache2
  • Install PHP5:
 sudo apt-get install php5
 sudo apt-get install php5-ldap
  • Install MySQL:
 sudo apt-get install mysql-server
 sudo apt-get install php5-mysql
  • Install sendmail
 sudo apt-get install sendmail
  • Download a copy of MIDAS3 from the current repository
 sudo apt-get install git-core
 cd <your-desired-installation-directory-for-midas3>
 git clone git://public.kitware.com/MIDAS/Midas3.git
  • Make sure the Midas3 installation directory is writable by the web server user
    • Note that www-data is the default web server user.
 cd <your-desired-installation-directory-for-midas3>
 sudo chown -R www-data:www-data Midas3
  • Enable mod_rewrite for apache2
 sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
  • Create a symbolic link to the actual directory where the MIDAS3 source code is located
 sudo ln -s  <your-desired-installation-directory-for-midas3>/Midas3 /var/www/midas
  • Edit /etc/apache2/sites-enabled/000-default (default website configuration)
    • Note that the directory /var/www/midas is the symbolic link created in the last step. You should change accordingly.
 <Directory "/var/www/midas/">
   Options FollowSymLinks
   AllowOverride All
   Order allow,deny
   Allow from all
  </Directory>
  • Set the following three values in /etc/php5/apache2/php.ini
 post_max_size = 2047M
 upload_max_filesize = 2047M
 memory_limit = 64M
 session.gc_probability = 0
 Warning: 2048M or more will cause MANY versions of Apache to crash
 Note: the post_max_filesize will be the largest file that can be uploaded without using the large file uploader
  • Restart the apache2 server:
 sudo /etc/init.d/apache2 restart
  • Add this line to your root user's crontab (this is in /etc/cron.d/php5)
 09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete


 Note: setting session.gc_probability = 0 and adding this cronjob are only necessary for Ubuntu, not CentOS. The difference is due to the different permissions on the php session directories.
 On Ubuntu:
 drwx-wx-wt    root      root      /var/lib/php5  
 -rw-------    www-data  www-data  /var/lib/php5/sess_osutk116j3tkuuflqs0tfpgu23
 On CentOS:
 drwxr-xr-x    root      root      /var/lib/php
 drwxrwx---    root      apache    /var/lib/session
 -rw-------    apache    apache    /var/lib/session/sess_doj79lvgoddf7a0t7vlmp79t14
 If this session.gc_probability is not set to 0 on Ubunutu installations, you will see errors like this periodically:
 Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()'


 mysql -u root -p
 <enter-password-for-mysql-root-user>
 mysql> create database midas character set = 'utf8';
 mysql> create user 'midas'@'localhost' identified by 'midas';
 mysql> grant all privileges on midas.* to 'midas'@'localhost';
  • Finish the MIDAS3 installation
 Type http://localhost/midas/install in your web browser.
 Follow the instructions to create your first user and initialize Midas3
  • Go here for more detailed installation instructions



User Documentation

Setup Administration Everyday Use
Personal tools