-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: Configure the Rails Application
randikathryn edited this page Feb 1, 2014
·
39 revisions
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.
- Enable the secret token for the site:
- Generate a string for the secret token with
cd /opt/$HYDRA_NAME && bundle exec rake secret
- 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 editsecret_token.rb
and replace the sample string with the string you just generated.
- Generate a string for the secret token with
- Enable a different secret token for devise (user authentication):
- Generate a second string for a different secret token with
cd /opt/$HYDRA_NAME && bundle exec rake secret
- 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.
- Generate a second string for a different secret token with
- 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
- 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"
- 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. - 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'
- Prepare the databases & assets
cd /opt/$HYDRA_NAME
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake assets:precompile
- 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
- Restart tomcat
Ubuntu:sudo service tomcat7 restart
CentOS:sudo service tomcat6 restart
- Restart apache
Ubuntu:sudo service apache2 restart
CentOS:sudo service httpd restart
- Open a browser and navigate to the home page
Proceed to Create an Admin User or return to the Overview page.