SSH into Root
$ ssh root@123.123.123.123
Change Root Password
# myapp | |
upstream unicorn_myapp { | |
server unix:/var/rails/myapp/current/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
server_name myapp.com www.myapp.com; | |
root /var/rails/myapp/current/public; |
# nginx.conf | |
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
timer_resolution 500ms; |
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to staging environment' | |
task :staging do | |
exec 'mina deploy -f config/deploy/staging.rb' | |
end | |
end |
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rvm' | |
# Usually mina focuses on deploying to one host and the deploy options are therefore simple. | |
# In our case, there is a number of possible servers to deploy to, it is therefore necessary to | |
# specify the host that we are targeting. | |
server = ENV['server'] | |
# Since the same host can have multiple applications running in parallel, it is necessary to |
SSH into Root
$ ssh root@123.123.123.123
Change Root Password
The MIT License (MIT) | |
Copyright (c) 2015 Oleg Ivanov http://github.com/morhekil | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
sudo cp nginx /etc/init.d/ | |
sudo update-rc.d nginx defaults | |
sudo chmod +x /etc/init.d/nginx | |
/etc/init.d/nginx start |
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps
ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config |