-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: Configure the Rails Application
acozine edited this page Jan 7, 2014
·
39 revisions
- Enable the secret token for the site:
- Generate a string for the secret token with
cd /opt/$HYDRA_NAME && 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 && rake secret
- 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.
- 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/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. - 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
- 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