Rails, Apache2 on Ubuntu (karmic) deployment

Posted by Steve on Stack Overflow See other posts from Stack Overflow or by Steve
Published on 2010-02-11T22:03:37Z Indexed on 2010/06/17 12:03 UTC
Read the original article Hit count: 341

I just need some clarification on a couple of files.

My site has an admin subdomain and SSL in addition to the normal *:80 details found in the virtual hosts.

My question(s): Do I need to specify a 1) ServerName and 2) DocumentRoot in: /etc/apache2/apache2.conf?

I currently enable my site from this directory: /etc/apache2/sites-available/site

Here are the contents of my site file in the above directory (/etc/apache2/sites-available/site):

<VirtualHost *:80>
  ServerName  www.site.com
  ServerAlias www.site.com

  DocumentRoot /home/user/public_html/site/current/public
  RailsAllowModRewrite off
  <directory "/home/user/public_html/site/current/public">
    Order allow,deny
    Allow from all
  </directory>
</VirtualHost>

<VirtualHost *:80> 
  ServerName www.site.com 
  ServerAlias admin.site.com
  DocumentRoot /home/user/public_html/site/current/public
  RailsAllowModRewrite off
  <directory "/home/user/public_html/site/current/public">
    Order allow,deny
    Allow from all
  </directory>
</VirtualHost>

<VirtualHost *:443>
  ServerName www.site.com
  ServerAlias www.site.com 

  # SSL releated
  SSLEngine on
  SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  SSLCertificateFile /path/to/site.com.crt
  SSLCertificateChainFile /path/to/bundle.crt
  SSLCertificateKeyFile /path/to/site.key

  # Used by rails
  RequestHeader set X_FORWARDED_PROTO "https"
</VirtualHost>

Do you see anything wrong?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about apache2