weathertopper / family-photo-project

0 stars 0 forks source link

Running a Rails server on a website #4

Closed weathertopper closed 7 years ago

weathertopper commented 7 years ago

I'm running an Apache server, I know there's a way to run it through that via some other tool. There might be a better way not involving the Apache server, I don't really care how this gets done. I just want to figure out how to get it done before I go much further.

weathertopper commented 7 years ago

https://nathanhoad.net/how-to-ruby-on-rails-ubuntu-apache-with-passenger

weathertopper commented 7 years ago

^^That's old, this isn't https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/

weathertopper commented 7 years ago

btw use this to log back in as me (userwise) sudo -u railsappuser -H bash -l

weathertopper commented 7 years ago

^^or just restart the terminal that's better

weathertopper commented 7 years ago

bundle exec rake assets:precompile db:reset db:setup db:seed RAILS_ENV=development DISABLE_DATABASE_ENVIRONMENT_CHECK=1

^^wipes out prod db too, beware

then restart server

sudo apache2ctl restart

weathertopper commented 7 years ago

FOR UPDATES, DO THIS: https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/deploy_updates.html

weathertopper commented 7 years ago

There are still lots of questions

But hey! Today was pretty productive!

weathertopper commented 7 years ago

Take secret file out of 'changed' in prod https://github.com/blog/2019-how-to-undo-almost-anything-with-git

weathertopper commented 7 years ago

run this for update

bundle install --deployment --without development test
bundle exec rake assets:precompile db:migrate RAILS_ENV=production
passenger-config restart-app $(pwd) //restarts server
weathertopper commented 7 years ago

Added this to a script in my prod directory so it's much easier now