views:

21

answers:

1

Hi, I am trying to configure SSL on my localhost using apache and phusion passenger. I am using virtualhosts.

I have the below configuration in sites-available/myapp


VirtualHost *:80
  ServerName myapp
  DocumentRoot /home/madhu/ror/myapp/public
  RailsEnv development
   Directory /home/madhu/ror/myapp/public
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    allow from all
   Directory
VirtualHost


VirtualHost *:443
  ServerName myapp
  DocumentRoot /home/madhu/ror/myapp/public
  ProxyPass / http://myapp/
  ProxyPassReverse / http://myapp/
  ProxyPreserveHost On
  RequestHeader set X_FORWARDED_PROTO 'https'
  Directory /home/madhu/ror/myapp/public
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    allow from all
  Directory
  SSLEngine On
  SSLProxyEngine On
  SSLCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem
  SSLProxyMachineCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem
VirtualHost

The SSL is enabled and everything works fine. But when I go to the url https://myapp/login , it says "The requested URL /login was not found on this server". When I look at the apache logs I found out that the request is going to /var/www/login istead of /home/madhu/ror/myapp/public. This was the error log


[client 127.0.0.1] File does not exist: /var/www/login

Is there anything I am missing? Please help

Thanks.

A: 

I had to put

  ServerName myapp
  DocumentRoot /home/madhu/ror/myapp/public
  RequestHeader set X_FORWARDED_PROTO 'https'
  Directory /home/madhu/ror/myapp/public
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    allow from all
  Directory
  SSLEngine On
  SSLProxyEngine On
  SSLCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem
  SSLProxyMachineCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem

in default-ssl :P silly mistake

Madhusudhan