-
Notifications
You must be signed in to change notification settings - Fork 319
Setup Instructions (Red Hat 7)
The instructions below were provided by a community member (@smoebot) and are not supported. Questions or issues can be reported here: https://github.com/Netflix/Scumblr/issues/128
From the command line run the following commands:
Set to development Environment
export RAILS_ENV=development
Install packages
sudo yum update
sudo yum install gcc gcc-c++ make zlib-devel openssl-libs openssl-devel readline-devel libyaml-devel sqlite-devel sqlite libxml2 libxml2-devel libxslt libxslt-devel libcurl-devel libffi-devel ImageMagick-devel ImageMagick redis linux-headers-generic
Install Bandit for python static code analysis (optional). Run the following from the command line
sudo yum install python-devel python-pip
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.3.1
rbenv global 2.3.1
Install gems
gem install bundler --no-ri --no-rdoc
gem install sidekiq --no-ri --no-rdoc
sudo yum install nodejs
gem install rails -v 4.2.6 --no-ri --no-rdoc
rbenv rehash
Run the following commands
wget http://apt.postgresql.org/pub/repos/yum/InstallPGDGRepoRPM.sh
./InstallPGDGRepoRPM.sh
Follow the instructions to install the temporary repo, then after it is complete, install packages
sudo yum update
sudo yum install postgresql95 postgresql95-server postgresql95-libs postgresql95-contrib postgresql95-devel postgresql-devel-9.2.18-1.el7.x86_64
Setup a database user
sudo -i -u postgres createuser scumblr -s
Setup a database password
sudo -u postgres psql
postgres=# \password scumblr
Type '\q' to quit
Run the following commands:
git clone https://github.com/Netflix/Scumblr.git
cd Scumblr
bundle install
You might have issues executing files from the /tmp directory, I got around it with:
sudo mount -o remount,exec /tmp
then, after you're done with the install
sudo mount -o remount,noexec /tmp
Edit the config/database.yml to point to your database. Example (update to match your username, password, host and database name):
development:
adapter: postgresql
host: localhost
port: 5432
username: scumblr
password: scumblr
database: scumblr_dev
pool: 5
timeout: 5000
Initialize the database
sudo /usr/pgsql-9.5/bin/postgresql95-setup initdb
Start postgresql
sudo service postgresql-9.5 start
Set postgresql to start on boot
chkconfig postgresql-9.5 on
Ensure that postgresql is in the list of services enabled
systemctl list-unit-files
There may be auth issues (IDENT failure) with getting rake to create the database, if so change the METHOD for the connection being used from 'ident' to 'md5'
sudo nano /var/lib/pgsql/9.5/data/pg_hba.conf
Create the database
rake db:create
rake db:structure:load
Initial Setup Setup an admin user
rails c
In the console:
user = User.new
user.email = "<Valid email address>"
user.password = "<Password>"
user.password_confirmation = "<Password>"
user.admin = true
user.save
Type "quit" to exit the console
Add an iptables rule to allow inbound connections
sudo iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
Start Scumblr From the command line from the Scumblr root folder:
redis-server &
bundle exec sidekiq -l log/sidekiq.log &
bundle exec rails s -b 0.0.0.0 &
Now connect to your server on port 3000 (http://localhost:3000 in a browser if running on your local machine).
There you go! Hopefully you have Scumblr running on Red Hat now. If not, then hopefully these steps can help to troubleshoot where it went wrong