We can deploy the app to servers via Capistrano
- Go to Bitnami Console to retreive
bitnami-hosting.pem
- Place the file under
APP_ROOT/config/deploy/keys/
- Change the permission of the file as 600 (
chmod 600 bitnami-hosting.pem
)
Connect server remotely via ssh, and configure the environment
cap production console # login remote shell
sudo su # switch to root
rvm get stable
rvm install ruby-2.1
You should reset password to the role 'bitnami'
sudo su # switch to root
su - postgres # switch to postgres
/opt/bitnami/postgresql/bin/psql
Then type the password, which is the application password assigned from bitnami console.
You are in psql
now:
ALTER ROLE bitnami with PASSWORD '<new password>' ;
CREATE DATABASE "nehsaa-mms/production" WITH OWNER bitnami ;
Finally, you can leave psql
by typing \q
.
Open /opt/bitnami/postgresql/data/pg_hba.conf
and change these lines:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
cd /opt/bitnami/apps
sudo mkdir nehsaa-mms
sudo chown bitnami: nehsaa-mms
Create and edit config/deploy/production/nehsaa.bitnamiapp.com.yml
app:
url_options:
protocol: https
database:
username: bitnami
cap production deploy
cap production console
cap production rails:console
cap production puma:status
cap production puma:start
cap production puma:stop
cap production puma:restart