-
Notifications
You must be signed in to change notification settings - Fork 1
Server Setup
~~ Work in Progress ~~
-
Spin up a server at DigitalOcean
-
Modify /etc/postgres.../pga_hba.conf file to allow MD5 authentication
-
Set up a database and database user
-
Install libpq-dev (needed for gem 'pg')
$ sudo apt-get install libpq-dev
-
Install NodeJS as JS runtime
$ sudo apt-get install nodejs
-
Set up Nginx, rvm, and Rails up to step 6
-
Deploy environment variables
$ cap production figaro_yml:setup
-
Install cerbot and get SSL certificates (may need temporary Nginx configuration for acme-challenge)
$ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install certbot $ sudo certbot certonly -a webroot --webroot-path /var/apps/upshift/shared/public -d <domain-name>
-
Update Diffie-Hellman Parameters
$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
-
Now continue Set up Nginx, rvm, and Rails up with step 7
-
Confirm that your site is live!
Are you getting the following error when running your Capistrano deployment?
PG::InsufficientPrivilege: ERROR: permission denied to create extension "citext"
HINT: Must be superuser to create this extension.
: CREATE EXTENSION IF NOT EXISTS "citext"
You will need to temporarily make your database user a superuser.
-
Connect to the server:
$ ssh user@server
-
Connect to PostgreSQL as the superuser (not your database user):
$ sudo su postgres $ \psql
-
Make your database user a superuser:
$ alter role your_user superuser;
-
Run
cap production deploy
from your local machine. This time it should succeed -
Remove superuser from your database user:
$ alter role your_user nosuperuser;
-
Leave PostgreSQL shell:
$ \q