Skip to content

Latest commit

 

History

History
91 lines (62 loc) · 3.33 KB

INSTALL.md

File metadata and controls

91 lines (62 loc) · 3.33 KB

Installation

Welcome to Openclerk 0.12+. These installation instructions are still under development - check out http://code.google.com/p/openclerk/issues/detail?id=3 for more information.

To install Openclerk:

  1. Install MySQL: (requires MySQL 5.1+ or 5.5+ for Openclerk 0.12+)

     sudo apt-get install mysql-server php5-mysql
    
  2. Install PHP/Apache: (requires PHP 5+)

     sudo apt-get install apache2 php5 php5-mysql php5-curl libapache2-mod-php5 php5-gd
     sudo a2enmod rewrite
     sudo service apache2 restart
    
  3. Install all the build dependencies:

     # install Ruby
     sudo apt-get install rubygems python-software-properties git
    
     # install NodeJS, npm
     sudo add-apt-repository ppa:chris-lea/node.js
     sudo apt-get update
     sudo apt-get install nodejs        # also installs npm from latest
    
     # install Composer, globally
     curl -sS https://getcomposer.org/installer | php
     sudo mv composer.phar /usr/local/bin/composer
    
     gem install sass
     npm install
     sudo npm install -g grunt-cli
     composer install
    
  4. If you are building through Jenkins, use these commands and ignore the rest:

     npm install
     composer install
     mysql -u root --password=password < config/reset_clerk_database.sql
     php -f core/install.php
     grunt test                  # JUnit output is in tests/report.xml
    
  5. Configure Apache to serve openclerk through the parent directory:

     Alias "/clerk" "/var/www/my.openclerk.org/site"
     <Directory "/var/www/my.openclerk.org/site">
        Options Indexes FollowSymLinks
        DirectoryIndex index.html index.php default.html default.php
        AllowOverride All
        Allow from All
        ErrorDocument 404 /404.php
     </Directory>
    
  6. Create a new MySQL database and new MySQL user:

     CREATE DATABASE openclerk;
     GRANT ALL ON openclerk.* to 'openclerk'@'localhost' IDENTIFIED BY '{password}'; 
    

Change {password} to anything you want. Keep this for the next step.

    FLUSH PRIVILEGES
  1. Edit inc/config.php as necessary, or create a config/config.php to overwrite these default configuration options. Don't forget to set database_password in ./inc/config.php to the same value you set it in the new MySQL database.

  2. Build through Grunt:

     sudo grunt deploy
    
  3. Set up cron jobs to execute the batch/batch_*.php scripts as necessary. Set 'automated_key' to a secure value, and use this as the first parameter when executing PHP scripts via CLI. For example:

     */1 * * * * cd /xxx/openclerk/batch && php -f /xxx/openclerk/batch/batch_run.php abc123
     */10 * * * * cd /xxx/openclerk/batch && php -f /xxx/openclerk/batch/batch_queue.php abc123
     0 */1 * * * cd /xxx/openclerk/batch && php -f /xxx/openclerk/batch/batch_external.php abc123
     30 */1 * * * cd /xxx/openclerk/batch && php -f /xxx/openclerk/batch/batch_statistics.php abc123
    
  4. Sign up as normal. To make yourself an administrator, execute MySQL:

     UPDATE users SET is_admin=1 WHERE id=?
    
  5. Visit the Admin Migrations page to complete installing the database migrations (new as of 0.31).

Or install with Chef

An experimental Chef cookbook that will install and configure Openclerk is available at https://github.com/soundasleep/openclerk-cookbook.