Skip to content

Installation: Configure the Rails Application

randikathryn edited this page Feb 1, 2014 · 39 revisions

Notes

Configure the Rails Application to make sure all the parts of the system are working together. This step includes the secret token, the fits path, solr configuration, the temporary transcoding directory, storage management, and more.

Steps

  1. Enable the secret token for the site:
    1. Generate a string for the secret token with cd /opt/$HYDRA_NAME && bundle exec 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 && bundle exec rake secret
    2. Copy /opt/$HYDRA_NAME/config/initializers/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/hydradam_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. Make the apache user own the passenger temp and xsendfile directories:
    Ubuntu: sudo chown www-data:www-data /opt/passenger_temp /opt/xsendfile
    CentOS: sudo chown apache:apache /opt/passenger_temp /opt/xsendfile
  9. Restart tomcat
    Ubuntu: sudo service tomcat7 restart
    CentOS: sudo service tomcat6 restart
  10. Restart apache
    Ubuntu: sudo service apache2 restart
    CentOS: sudo service httpd restart
  11. Open a browser and navigate to the home page

Verification/Validation Steps

Next Step

Proceed to Create an Admin User or return to the Overview page.

Clone this wiki locally