You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# /opt/nginx/conf/nginx.conf
...
server {
listen 80;
server_name www.luna.com luna.com;
root /home/luna/app/current/public; # <--- be sure to point to 'public'!
passenger_enabled on;
}
...
$ restart nginx
$ curl localhost
MySQL
$ apt-get install mysql-server libmysqlclient-dev
$ echo "create database luna_production" | mysql -u root -p
$ echo "grant all on luna_production.* to luna@localhost identified by 'luna123'" | mysql -u root -p
Capistrano
$ vim Gemfile
group :development do
...
gem 'capistrano'
gem 'capistrano-ext'
gem 'rvm-capistrano'
...
end
$ bundle
$ capify .
$ vim config/deploy.rb
Uncomment:
passenger stuff
Add:
require 'rvm/capistrano'
require 'bundler/capistrano'
set :deploy_via, :remote_cache
set :use_sudo, false
set :user, "luna"
set :deploy_to, "~/app"
set :rails_env, "production"
set :rvm_type, "system"
set :keep_releases, 3
after "deploy:restart", "deploy:cleanup"
namespace :deploy do
desc "Symlink shared/* files"
task :symlink_shared, :roles => :app do
run "ln -nfs #{shared_path}/database.yml #{release_path}/config/database.yml"
end
desc "Precompile assets"
task :assets_precompile do
run "cd #{release_path}; RAILS_ENV=#{rails_env} bundle exec rake assets:precompile"
end
end
after "deploy:update_code", "deploy:symlink_shared"
after "deploy:update_code", "deploy:assets_precompile"
$ cap deploy:setup
$ scp config/database.yml.example luna@luna.com:~/app/shared/database.yml
$ ssh luna@luna.com
vim app/shared/database.yml
rake db:setup
$ cap deploy
$ ssh git@github.com
$ cap deploy