HowTo configure Apache to run Redmine » History » Version 1
Cyber Sprocket, 2009-06-02 06:32
| 1 | 1 | Cyber Sprocket | h1. HowTo configure Apache to run Redmine |
|---|---|---|---|
| 2 | |||
| 3 | These notes assume you already have Redmine running via the webrick server and are looking to get Redmine running via your existing Apache installation. |
||
| 4 | |||
| 5 | Most of the commands assume you are in the root installation directory of redmine, so be sure to change directory there before starting. |
||
| 6 | |||
| 7 | h2. For CentOS 5 |
||
| 8 | |||
| 9 | h3. Assumptions |
||
| 10 | |||
| 11 | * OS is CentOS 5 |
||
| 12 | * Web server is Apache 2 |
||
| 13 | ** mod_cgi is enabled |
||
| 14 | ** name based virtual servers are being used |
||
| 15 | |||
| 16 | h3. Basic Steps |
||
| 17 | |||
| 18 | * Install Redmine per the installation instructions and get it running with webrick. |
||
| 19 | |||
| 20 | * Kill the webrick session |
||
| 21 | |||
| 22 | * Copy the public/dispatch.cgi.example to public/dispatch.cgi |
||
| 23 | |||
| 24 | * Edit public/dispatch.cgi to fix the shell script invocation to read: |
||
| 25 | @#!/usr/local/bin/ruby@ |
||
| 26 | |||
| 27 | * Make sure public/dispatch.cgi has execute permissions via: |
||
| 28 | @# chmod 755 public/dispatch.cgi@ |
||
| 29 | |||
| 30 | * Update the config/environment.rb file to force the rails environment to production, simply uncomment this line at the start of the file: |
||
| 31 | @ENV['RAILS_ENV'] ||= 'production'@ |
||
| 32 | |||
| 33 | * Add your virtual host entry to the apache configuration file (/etc/httpd/conf/httpd.conf). We installed redmine into the /live/redmine folder on our server. _Note: be sure to point your DocumentRoot to the public sub-folder!_ |
||
| 34 | <pre> |
||
| 35 | <VirtualHost *:80> |
||
| 36 | ServerName redmine.<YOUR-DOMAIN>.com |
||
| 37 | ServerAdmin webmaster@<YOUR-DOMAIN>.com |
||
| 38 | DocumentRoot /live/redmine/public/ |
||
| 39 | ErrorLog logs/redmine_error_log |
||
| 40 | |||
| 41 | <Directory "/live/redmine/public/"> |
||
| 42 | Options Indexes ExecCGI FollowSymLinks |
||
| 43 | Order allow,deny |
||
| 44 | Allow from all |
||
| 45 | AllowOverride all |
||
| 46 | </Directory> |
||
| 47 | </VirtualHost> |
||
| 48 | </pre> |
||
| 49 | |||
| 50 | * Make sure your files, log, tmp, and vendor directories are all accessible (read/write) by user apache, group apache. We did that via a change of ownership: |
||
| 51 | @# chown -R apache:apache files log tmp vendor@ |
||
| 52 | |||
| 53 | |||
| 54 | h3. Gotchas |
||
| 55 | |||
| 56 | Look for rogue versions of ruby binaries. We had an older version in /usr/bin/ruby as well as /usr/local/bin/ruby which caused a rather generic error message: |
||
| 57 | _@Rails requires RubyGems >= 0.9.4. Please install RubyGems@_ |
||
| 58 | |||
| 59 | Helpful commands: |
||
| 60 | @# which ruby@ - tells you which ruby binary is being run when the fully-qualified-filename has not been specified. |
||
| 61 | @# find / -name ruby@ - searches your entire system for any file named ruby, warning: can take a while on large filesystems. |