-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: Configure the Rails Application
acozine edited this page Jun 20, 2013
·
39 revisions
- 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.
- 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
- 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
- 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
- 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/
- 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
- 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"
- 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
- 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
- Prepare the databases & assets
cd /opt/$PROJECT_NAME
RAILS_ENV=production rake db:migrate
rake assets:precompile
- Enable the secret token:
- Generate a string for the secret token with
cd /opt/$PROJECT_NAME && rake secret
- Generate a string for the secret token with
- 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.
- Restart tomcat and check that fedora and solr are running
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