Skip to content

Installation: Configure the Rails Application

acozine edited this page Jan 7, 2014 · 39 revisions
  1. Enable the secret token for the site:
    1. Generate a string for the secret token with cd /opt/$HYDRA_NAME && rake secret
    2. Copy /opt/$HYDRA_NAME/config/initializers/secret_token.rb.sample to /opt/$HYDRA_NAME/config/initializers/secret_token.rb cp /opt/$HYDRA_NAME/config/initializers/secret_token.rb.sample /opt/$HYDRA_NAME/config/initializers/secret_token.rb
      Then edit secret_token.rb and replace the sample string with the string you just generated.
  2. Enable a different secret token for devise (user authentication):
    1. Generate a second string for a different secret token with cd /opt/$HYDRA_NAME && rake secret
    2. Copy /opt/$HYDRA_NAME/config/initalizers/devise.rb.sample to /opt/$HYDRA_NAME/config/initializers/devise.rb and replace the sample string with the string you just generated.
  3. Symlink the solrconfig.xml and schema.xml files from the application into solr: sudo ln -sf /opt/$HYDRA_NAME/solr_conf/conf/schema.xml /opt/solr/$HYDRA_NAME/collection1/conf/schema.xml sudo ln -sf /opt/$HYDRA_NAME/solr_conf/conf/solrconfig.xml /opt/solr/$HYDRA_NAME/collection1/conf/solrconfig.xml
  4. Set the fits path: Edit /opt/$HYDRA_NAME/config/initializers/sufia.rb and configure the path to fits: config.fits_path = Rails.env.production? ? '/usr/local/bin/fits.sh' : "fits.sh"
  5. Create and configure the temporary directory for transcoding - to use the default:
    mkdir /opt/bawstun_tmp
    To use a different directory name, edit /opt/$HYDRA_NAME/config/initializers/sufia.rb and change the config.temp_file_base setting to your preferred name, then create your directory. The temporary transcoding directory should be owned by $USER.
  6. Set the storage manager for your application: Edit /opt/$HYDRA_NAME/config/application.rb and configure the storage manager:
    if you're using an HSM, you want
    config.storage_manager = 'SamfsStorageManager'
    if you're using the local filesystem, you want
    config.storage_manager = 'NullStorageManager'
  7. Prepare the databases & assets
    cd /opt/$HYDRA_NAME
    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake assets:precompile
  8. Restart tomcat
    Ubuntu: sudo service tomcat7 restart
    CentOS: sudo service tomcat6 restart
  9. Restart apache
    Ubuntu: sudo service apache2 restart
    CentOS: sudo service httpd restart
  10. Open a browser and navigate to the home page
Clone this wiki locally