How to host Ruby Rails application in https .

How to make my ruby on rails application to work on with https protocol . My application rails version - 2.3.8 . I use phusion passenger and apache as server . Kindly help me how to make it up .

How to make my ruby on rails application to work on with https protocol . My application rails version - 2.3.8 . I use phusion passenger and apache as server . Kindly help me how to make it up .

That's not Rails specific. You need to setup your Apache server to use SSL. I'm not an Apache expert, but I think you have to: - Enable mod_ssl - Setup the port SSL will listen to (The default might be commented on your conf file) - Define your virtualhost for that port.

If your server already has SSL configured, you only need to define your vhost.

Hope it helps.

Thanks pal. Using a single apache with multiple virtual host im able to achieve https and run my run application .

<VirtualHost *:8080>

ServerName somename.com

Options FollowSymLinks RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

</VirtualHost>

<VirtualHost *:443> RailsEnv development    <Directory />       Options FollowSymLinks       AllowOverride None       Order deny,allow # Deny from none       Allow from all    </Directory> ProxyPreserveHost on

Document /home/sasi/SampleApp/public

ServerName somename.com ErrorLog "/usr/local/apache2/logs/error_log" TransferLog "/usr/local/apache2/logs/access_log" SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW: +SSLv2:+EXP:+eNULL

SSLCertificateFile "/home/sasi/Demo_ssl_root_certificates/ ssl_demo211.cer"

<FilesMatch "\.(cgi|shtml|phtml|php)$">     SSLOptions +StdEnvVars </FilesMatch> <Directory "/usr/local/apache2/cgi-bin">     SSLOptions +StdEnvVars </Directory>

BrowserMatch ".*MSIE.*" \          nokeepalive ssl-unclean-shutdown \          downgrade-1.0 force-response-1.0

CustomLog "/usr/local/apache2/logs/ssl_request_log" \           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" </Virtualhost>

Through single server setup im able to achieve this (placing app and db in the server ) works fine. Can u suggest me . How can i achieve this in a three tier architecture . (Web component simple apache , App server containing passenger module with apache pointing the application , db server in a seperate machine ) . Between web,db and app im able to esatblish connection. But with respect to https . When i call from webserver to app internally the URL shifts back to http from https so url breaks up in this case. Any ruby plugin / gum which will support https (SSL) to stay .