Setting Up SSL on AWS Bitnami Instance of Ruby on Rails (Apache)
Setting up SSL on the Bitnami instance of Ruby on Rails is easy.
- First, you’ll want to make sure that you’ve purchased your SSL certificates for your domain
- Next, log in to your EC2 instance
- place the .key and .crt files you have for your SSL certificate in your apps’s root directory
- go to your app’s root and move the files to the correct directory with
mv yourcrt.crt /opt/bitnami/apache2/conf/extra/yourcrt.crt
mv yourkey.key /opt/bitnami/apache2/conf/extra/yourkey.key
5. the httpd.conf file that the instance comes with already points to another file for the ssl configuration, so we’ll want to edit that file that is being used.
6. enter “cd /opt/bitnami/apache2/conf/extra”
7. enter “pico httpd-ssl.conf” to edit the ssl configuration
8. in the file (CNTL + X to save when you are done):
- change the “DocumentRoot” to “home/bitnami/apps/yourapp/public” or where ever your app is
- change the “ServerName” to http://www.yourdomain.com:443
- change the “ServerAdmin” to your email
- change the “SSLCertificateFile” to “/opt/bitnami/apache2/conf/extra/yourcrt.crt”
- change the “SSLCertificateKeyFile” to “/opt/bitnami/apache2/conf/extra/yourkey.key”
9. stop and restart your server
apachectl -k stop
apachectl -k graceful
Your app should now be successfully set-up for SSL.