-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: Configure the Rails Application
Configure the Rails Application to make sure that 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 by completing the steps below.
- Generate a string for the secret token by entering the command
cd /opt/$HYDRA_NAME && bundle exec rake secret
in the terminal window. - Copy /opt/$HYDRA_NAME/config/initializers/secret_token.rb.sample to /opt/$HYDRA_NAME/config/initializers/secret_token.rb by entering the command
cp /opt/$HYDRA_NAME/config/initializers/secret_token.rb.sample /opt/$HYDRA_NAME/config/initializers/secret_token.rb
. - Edit
secret_token.rb
and replace the sample string with the string you just generated.
- Generate a string for the secret token by entering the command
-
Enable a different secret token for devise (user authentication) by completing the steps below.
- Generate a second string for a different secret token by entering the command
cd /opt/$HYDRA_NAME && export DEVISE_SECRET=$(bundle exec rake secret)
. - Copy /opt/$HYDRA_NAME/config/initializers/devise.rb.sample to /opt/$HYDRA_NAME/config/initializers/devise.rb
cp /opt/$HYDRA_NAME/config/initializers/devise.rb.sample /opt/$HYDRA_NAME/config/initializers/devise.rb
. - Replace the sample string with the string you just generated by entering the command
sed -i.bak s/key\ =\ \'.*\'/key\ =\ \'$DEVISE_SECRET\'/g /opt/$HYDRA_NAME/config/initializers/devise.rb
- Generate a second string for a different secret token by entering the command
-
Symlink the solrconfig.xml and schema.xml files from the application into Solr by entering the commands:
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 for sufia by entering the command
sed -i.bak "s/\/home\/ubuntu\/fits-0\.6\.1\/fits\.sh/\/usr\/local\/bin\/fits\.sh/g" /opt/$HYDRA_NAME/config/initializers/sufia.rb
. -
Create and configure the temporary directory for transcoding to use the default directory by entering the command
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. -
If you are using the local filesystem for storage, skip this step. The storage manager setting determines what kind of storage hydra expects for your fedora objects. The default setting is "NullStorageManager", which means you're using the local filesystem. If you are using an HSM to store your fedora objects, you must edit /opt/$HYDRA_NAME/config/application.rb and change the config.storage_manager line to
config.storage_manager = 'SamfsStorageManager'
. -
Prepare the databases & assets by entering the commands:
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 using the command
Ubuntu:sudo chown www-data:www-data /opt/passenger_temp /opt/xsendfile
CentOS:sudo chown apache:apache /opt/passenger_temp /opt/xsendfile
-
Restart tomcat using the command
Ubuntu:sudo service tomcat7 restart
CentOS:sudo service tomcat6 restart
-
Restart apache using the command
Ubuntu:sudo service apache2 restart
CentOS:sudo service httpd restart
- Open a browser and navigate to the home page of your application. You should see the default HydraDAM home page.
Proceed to Create an Admin User or return to the Overview page.