Hello all,

I am having some trouble getting rails to work with both http and
https. Using http everything works fine but I want to use SSL for user
login and I am not sure how to achieve this with my current setup.

What i happening is when I go to to start my user session, apache2 is
telling me:

Not Found

The requested URL /vell/user_session/new was not found on this server.

If I try to go to the root of the site using https, I get a listing of
the public directory files. If I go to the root of the site using http
it renders properly.

Here is what I have so far:

My app resides in my user directory
/home/vmcilwain/apps/vell

I have a symlink in /var/www that points to the public directory of
the app

Here is what I have in my apache2 config file for both http and https
virtual hosts:

<VirtualHost *:80>
ServerName <my.site.name>
DocumentRoot /var/www
Include rails
RailsEnv production
</VirtualHost>

<VirtualHost <my.site.name>:443>
ServerName <my.site.name>
SSLEngine on
SSLCertificateFile ssl/server.crt
SSLCertificateKeyFile ssl/server.key
DocumentRoot /var/www
Include rails
RailsEnv production
<Directory '/home/vmcilwain/apps/*/current/public'>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

As far as I can tell, this is all that I need to get both http and
https working so I am curious as to what I may be missing.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Vell at Dec 22, 2011 at 7:24 pm

    On Dec 21, 10:59 pm, Vell wrote:
    Hello all,

    I am having some trouble getting rails to work with both http and
    https. Using http everything works fine but I want to use SSL for user
    login and I am not sure how to achieve this with my current setup.

    What i happening is when I go to to start my user session, apache2 is
    telling me:

    Not Found

    The requested URL /vell/user_session/new was not found on this server.
    Update: The apache error log is giving me the following error when I
    try to access my site via https:
    [Thu Dec 22 14:21:12 2011] [error] [client 192.104.65.1] File does not
    exist: /home/vmcilwain/apps/vell/user_session, referer: http://my.site.net/vell

    If I go to to any part of my site through https, I just get a
    directory listing. So if I were to do https://my.site.net/vell it
    would show me all the folders in the root directory of the
    application.
    If I try to go to the root of the site using https, I get a listing of
    the public directory files. If I go to the root of the site using http
    it renders properly.

    Here is what I have so far:

    My app resides in my user directory
    /home/vmcilwain/apps/vell

    I have a symlink in /var/www that points to the public directory of
    the app

    Here is what I have in my apache2 config file for both http and https
    virtual hosts:

    <VirtualHost *:80>
    ServerName <my.site.name>
    DocumentRoot /var/www
    Include rails
    RailsEnv production
    </VirtualHost>

    <VirtualHost <my.site.name>:443>
    ServerName <my.site.name>
    SSLEngine on
    SSLCertificateFile ssl/server.crt
    SSLCertificateKeyFile ssl/server.key
    DocumentRoot /var/www
    Include rails
    RailsEnv production
    <Directory '/home/vmcilwain/apps/*/current/public'>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    As far as I can tell, this is all that I need to get both http and
    https working so I am curious as to what I may be missing.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Vell at Dec 22, 2011 at 8:05 pm

    On Dec 22, 2:24 pm, Vell wrote:
    On Dec 21, 10:59 pm, Vell wrote:> Hello all,
    I am having some trouble getting rails to work with both http and
    https. Using http everything works fine but I want to use SSL for user
    login and I am not sure how to achieve this with my current setup.
    What i happening is when I go to to start my user session, apache2 is
    telling me:
    Not Found
    The requested URL /vell/user_session/new was not found on this server.
    Update: The apache error log is giving me the following error when I
    try to access my site via https:
    [Thu Dec 22 14:21:12 2011] [error] [client 192.104.65.1] File does not
    exist: /home/vmcilwain/apps/vell/user_session, referer:http://my.site.net/vell
    Another Update: I was finally able to get this to work. My issues were
    that I didn't set my DocumentRoot to /var/www in my ssl vhost and
    changing the railsenv to development (not sure why that should have
    mattered).
    If I go to to any part of my site through https, I just get a
    directory listing. So if I were to dohttps://my.site.net/vellit
    would show me all the folders in the root directory of the
    application.






    If I try to go to the root of the site using https, I get a listing of
    the public directory files. If I go to the root of the site using http
    it renders properly.
    Here is what I have so far:
    My app resides in my user directory
    /home/vmcilwain/apps/vell
    I have a symlink in /var/www that points to the public directory of
    the app
    Here is what I have in my apache2 config file for both http and https
    virtual hosts:
    <VirtualHost *:80>
    ServerName <my.site.name>
    DocumentRoot /var/www
    Include rails
    RailsEnv production
    </VirtualHost>
    <VirtualHost <my.site.name>:443>
    ServerName <my.site.name>
    SSLEngine on
    SSLCertificateFile ssl/server.crt
    SSLCertificateKeyFile ssl/server.key
    DocumentRoot /var/www
    Include rails
    RailsEnv production
    <Directory '/home/vmcilwain/apps/*/current/public'>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>
    As far as I can tell, this is all that I need to get both http and
    https working so I am curious as to what I may be missing.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedDec 22, '11 at 3:59a
activeDec 22, '11 at 8:05p
posts3
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Vell: 3 posts

People

Translate

site design / logo © 2022 Grokbase