Skip to content

Installation: Configure the Rails Application

acozine edited this page Jun 20, 2013 · 39 revisions
  1. Create the .yml files for mysql, fedora, redis, and solr. In the/opt/$PROJECT_NAME/config directory, copy database.yml.sample, fedora.yml.sample, redis.yml.sample, and solr.yml.sample to create database.yml, fedora.yml, redis.yml, and solr.yml files.
  2. Edit the database.yml file and change the production section so it points to your sql database. If you've followed the instructions here, it should read:
    production:
    adapter: mysql2
    host: localhost
    database: yourproductiondb_name
    username: yourmysqlappusername
    password: yourmysqlapppw
    pool: 5
    timeout: 5000
  3. Edit the fedora.yml file and change the production section so it points to your fedora. If you've followed the Install Fedora instructions here, it should read:
    production:
    user: fedoraAdmin
    password: fedoraAdmin
    url: http://127.0.0.1:8080/fedora
  4. Edit the redis.yml file and add a production section that points to your redis server. If you've followed the Install Redis instructions here, it should read:
    production:
    host: localhost
    port: 6379
  5. Edit the solr.yml file and add a production section that points to your solr. If you've followed the Install Solr instructions here, it should read:
    production:
    url: http://127.0.0.1:8080/hydradam/
  6. Symlink the solrconfig.xml and schema.xml files from the application into solr: sudo ln -sf /opt/$PROJECT_NAME/solr_conf/conf/schema.xml /opt/solr/$PROJECT_NAME/collection1/conf/schema.xml sudo ln -sf /opt/$PROJECT_NAME/solr_conf/conf/solrconfig.xml /opt/solr/$PROJECT_NAME/collection1/conf/solrconfig.xml
  7. Set the fits path: Edit /opt/$PROJECT_NAME/config/initializers/sufia.rb and configure the path to fits: config.fits_path = Rails.env.production? ? '/usr/local/bin/fits.sh' : "fits.sh"
  8. Create and configure the temporary directory for transcoding - the default setting is /opt/bawstun_tmp, set in /opt/bawstun/config/initializers/sufia.rb sudo mkdir /opt/bawstun_tmp
  9. Give the apache user ownership of the temporary transcoding directory: Ubuntu: sudo chown www-data:www-data /opt/bawstun_tmp
    CentOS: sudo chown apache:apache /opt/bawstun_tmp
  10. Prepare the databases & assets
    cd /opt/$PROJECT_NAME
    RAILS_ENV=production rake db:migrate
    rake assets:precompile
  11. Enable the secret token:
    1. Generate a string for the secret token with cd /opt/$PROJECT_NAME && rake secret
  12. Copy /opt/$PROJECT_NAME/config/initializers/secret_token.rb.sample to /opt/$PROJECT_NAME/config/initializers/secret_token.rb and replace the sample string with the string you just generated.
  13. Restart tomcat and check that fedora and solr are running
    Ubuntu: sudo service tomcat7 restart
    CentOS: sudo service tomcat6 restart
  14. Restart apache
    Ubuntu: sudo service apache2 restart
    CentOS: sudo service httpd restart
  15. Open a browser and navigate to the home page
Clone this wiki locally