-
Notifications
You must be signed in to change notification settings - Fork 1
Create Hyrax application
Steps to Install data2paper
Reference: All online sources and documents referred to in this document are detailed here
-
Create a Linux virtual machine with the Azure portal
- 4 cores, 16 GB RAM, OS: Ubuntu 16.04
- Open port 80
-
Create a new user for the application called appuser and ssh as that user
-
Install node.js using the ppa This is needed for runtime of app
-
Install Ruby on Rails with rbenv
- Installed Ruby 2.4.2
rbenv install 2.4.2 - Rails 5.1.4 (Did not run
echo "gem: --no-document" > ~/.gemrcas I didn't want to skip the docs)
- Installed Ruby 2.4.2
-
Install Hyrax pre-requisites
NOTE: Solr and Fedora are not needed for dev mode.- Solr version >= 5.x
- Fedora version >= 4.5.1
- Install Redis
sudo apt-get install redis-server && sudo systemctl enable redis-server.service - Install Postgres and create user
- Install postgres
sudo apt-get update && sudo apt-get install postgresql postgresql-contrib libpq-dev - Create postgres user
sudo -u postgres createuser -s data2paper - Set the password for the user
sudo -u postgres psql # set the password \password data2paper # enter password and confirm \q
- Install postgres
- Install Fits
- Install Java if not already installed. Instructions
- Download Fits
cd /home/appuser wget http://projects.iq.harvard.edu/files/fits/files/fits-1.0.5.zip sudo apt-get install unzip unzip fits-1.0.5.zip - Make fits.sh an executable
cd fits-1.0.5/ chmod a+x fits.sh - Test fits.sh -h return a value
./fits.sh -h - Add full path for fits.sh to $PATH
Add the full path for fits.sh to $PATH
Add this to the file ~/.profile
PATH=/home/appuser/fits-1.0.5/fits.sh:$PATHAfter modifications, my path in the looks likevim ~/.profilePATH="$HOME/bin:$HOME/.local/bin:$PATH:$HOME/fits-1.0.5/fits.sh" - Also modify config/initializers/hyrax.rb and set the full path for fits in it
config.fits_path = "/home/appuser/fits-1.0.5/fits.sh"
- Install Libre office for derivtaives
Ifwhich sofficereturns a path, you're done. if not,install libre officeTestsudo apt install libreoffice-commonwhich sofficereturns a path
- Install image magic
sudo apt-get install imagemagick
-
Either Generate the rails app
rails _5.1.4_ new data2paper -m https://raw.githubusercontent.com/samvera/hyrax/v2.0.0.rc1/template.rb -
OR Clone the Data2paper repository
- Clone the repository
git clone https://github.com/anusharanganathan/data2paper.git - Install the gems
bundle install
- Clone the repository
-
Create a file with the environment variables
Install rbenv-vars plugincd ~/.rbenv/plugins git clone https://github.com/sstephenson/rbenv-vars.git cd ~/data2paper/Generate the secret key for cookies
rake secretCreate the file for environment variables (using rbenv-vars plugin)
vim .rbenv-varsAdd the key and values similar to https://github.com/anusharanganathan/data2paper/wiki/Settings-for-rbenv-vars
Test the file can be read fine with rbenvrbenv vars -
Create the database and run the migrations
Note Currently need to change the password in config/database.ymlbundle exec rake db:createRun the migrations
bundle exec rake db:migrate -
Fetch Solr, Fedora and start the application
bundle exec rails hydra:server -
- Sign up as a new user at the url /users/sign_up
- Assign the admin role to the user
admin = Role.create(name: "admin") admin.users << User.find_by_user_key( "your_admin_users_email@fake.email.org" ) admin.save -
Run the rake task to disable features not used
bundle exec rake features:set["show_deposit_agreement:false","active_deposit_agreement_acceptance:false","assign_admin_set:false","batch_upload:false"] -
- Restart the rails server (or puma service) and then visit /sidekiq to see the Sidekiq web app
Next: Running Hyrax in development to run the application
Next: Configure SSL certificate using Lets Encrypt with NGinx