-
Notifications
You must be signed in to change notification settings - Fork 56
Adopta Install Notes
I installed this on RHEL 5 (Redhat) linux. Here are my notes. I will dump them here for now and clean them up as I go. Note that these are just my personal notes for my initial install. It's a bit ugly, but my have some key points.
Configure/Install app notes notes to be added to GitHub and forked adopta code base for Raleigh [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum groupinstall 'development tools' [foleyc@rordevapp1 adopt-a-hydrant]$ curl -L get.rvm.io | bash -s stable #installs rvm [foleyc@rordevapp1 adopt-a-hydrant]$ source /home/CORALEIGH/foleyc/.rvm/scripts/rvm [foleyc@rordevapp1 adopt-a-hydrant]$ rvm install 1.9.3 [foleyc@rordevapp1 adopt-a-hydrant]$ rvm pkg install libyaml [foleyc@rordevapp1 adopt-a-hydrant]$ rvm reinstall all --force [foleyc@rordevapp1 adopt-a-hydrant]$ rvm requirements [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install -y gcc-c++ patch readline readline-devel zlib zlib- devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
[foleyc@rordevapp1 adopt-a-hydrant]$ rvm reinstall 1.9.3 [foleyc@rordevapp1 adopt-a-hydrant]$ gem install rails --no-rdoc --no-ri [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install postgresql-server
#must be root $sudo su - $service postgresql initdb $service postgresql start $chkconfig postgresql on
#To connect to your postgres server simply do this (as root): $su postgres $psql -p 5432
#exit out back to foleyc shell [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install postgresql-devel [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install sqlite-devel
[foleyc@rordevapp1 adopt-a-hydrant]$ git clone git://github.com/codeforamerica/adopt-a-hydrant.git [foleyc@rordevapp1 adopt-a-hydrant]$ cd adopt-a-hydrant [foleyc@rordevapp1 adopt-a-hydrant]$ bundle install
#must be root $sudo su - edit /var/lib/pgsql/data/pg_hba.conf and change all to trusted
cd /var/lib/pgsql/data/
"simply connect to db"
-bash-4.1$ psql adopt_a_thing_development //then you can run your queries etc.
//not working for me -bash-4.1$ sudo -u postgres psql postgres
postgres=#su postgres postgres=#create role foleyc login createdb; postgres=#\du #lists all users postgres=#\list #lists all databases postgres=#\q #quits
#exit out back to foleyc [foleyc@rordevapp1 adopt-a-hydrant]$bundle exec rake db:create [foleyc@rordevapp1 adopt-a-hydrant]$bundle exec rake db:schema:load
#install passenger [foleyc@rordevapp1 adopt-a-hydrant]$gem install rails passenger [foleyc@rordevapp1 adopt-a-hydrant]$passenger-install-apache2-module #failed b/c of dependencies, install dependencies from the prompt [foleyc@rordevapp1 adopt-a-hydrant]$sudo yum install curl-devel [foleyc@rordevapp1 adopt-a-hydrant]$sudo yum install httpd [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install httpd-devel [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install apr-devel [foleyc@rordevapp1 adopt-a-hydrant]$ sudo yum install apr-util-devel [foleyc@rordevapp1 adopt-a-hydrant]$passenger-install-apache2-module #succeeds edit /etc/httpd/conf/httpd.conf and add the following lines to the bottom of the file
LoadModule passenger_module /home/CORALEIGH/foleyc/.rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.18/ext/apache2/mod_passenger.so PassengerRoot /home/CORALEIGH/foleyc/.rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.18 PassengerRuby /home/CORALEIGH/foleyc/.rvm/wrappers/ruby-1.9.3-p286/ruby
<VirtualHost *:80> ServerName www.yourhost.com # !!! Be sure to point DocumentRoot to 'public'! DocumentRoot /home/CORALEIGH/foleyc/adopt-a-hydrant/public <Directory /home/CORALEIGH/foleyc/adopt-a-hydrant/public> # This relaxes Apache security settings. AllowOverride all # MultiViews must be turned off. Options -MultiViews
#restart apache sudo /etc/init.d/httpd restart
browse to http://rordevapp1 and the app should come up.
todo: seed lat/lng coordinates, change graphics, center map on Raleigh, config email server, get a decent url name Also see buglist for adding city_id, lat, lng to attr in things.rb model edited /home/xfinger/adopt-a-hydrant/app/mailers/thing_mailer.rb to make the from address a cor address edit /home/xfinger/adopt-a-hydrant/app/views/thing_mailer/reminder.text.erb configure email (smtp) in config/environments/production.rb center map on Raleigh - inside main.js.erb in /assets/javascripts
--Become an admin of the site
app/assets/javascripts/main.js.erb - edit line 2 to LatLng(35.7719, -78.6389); to center your map in raleigh. config/initializers/locals/en.yml - edit the defaults info to change address city state ... these show up on the left hand info panel the app uses rails_admin gem (https://github.com/sferik/rails_admin) for administration stuff. It's at url/admin but you have to be an admin to access it. To become an admin, open a rails console (just type 'rails console' at command line) and do User.find(:all). Find your user id (probably 1 if you are the first or only user in the db). Now type a=User.find(1). Then a.admin = true. Then a.save. You should now be an admin. If you look at the admin panel there is a place to create reminders and send them to users but I couldn't get it to work. It requires a from user field but the drop down selector did not show up on mine so it kept throwing an error. I will look into it. That didn't work so I wasn't able to test out the email stuff. The app didn't have mailer.yml file in the config directory - seems to me that you need it but they may have set things up differently. If you have trouble seeding in production let me know, I had to tweak the model to get it to work.
/u01/apps/adopt-a-shelter/app/views/sidebar
[foleyc@rordevapp1 sidebar]$ vim _combo_form.html.haml
http://www.raleighnc.gov/content/PWksTransit/Documents/AdoptaShelter.pdf
Update the tos.
you can search for terms to find where to make edits using this command
$grep –iR keyword-to-search ./
postgres become super user
ALTER USER myuser WITH SUPERUSER; backup database: -bash-4.1$ pg_dump -U rubyapps adopt_a_thing_development > adopt_a_thing_development_dev_db