Installing Redmine 2.x to cPanel
NOTE: This requires that you have already followed my guide on installing Rails 3.x and mod_passenger for Apache. The latest version of Redmine (2.x) is no longer compatible with Rails 1.x/2.x. If you need to install just Redmine 1.x, the normal methods will work with cPanel's default Ruby/RoR setup.
NOTE: This is highly unsupported. Following this script will guarantee a clean install, but I am not very experienced with Rails applications.
NOTE: This guide also assumes that you will be running Redmine directly at the root of a domain or subdomain vhost in cPanel. Note that all of the rails files need to be one directory above the DocumentRoot for your virtual host, and the 'public' directory within the rails app needs to be moved to the real DocumentRoot. You can create a symbolic link to accomplish this. The examples I use below are for if Redmine is installed to the root of a main domain.
Installing Redmine
If a cPanel account doesn't exist, create one. Then create a database and user in WHM named username_redmine and assign the user to the DB
The following will calibrate your shell session and install improved MySQL support for Ruby Gems along with the bundler application the redmine install process uses
Download source for redmine, latest tar.gz from their RubyForge page to /usr/local/src
(this may merge the tmp folder from the rails app with the cPanel account’s tmp folder, which is normal)
Below, you are moving the webroot portion of the rails app to your document root for the cPanel account, and then creating a symlink so Rails is none the wiser
This will finalize the install by installing all of the necessary gems and populating the default production database. This install assumes you are not using a development and/or test database
Edit /home/username/config/database.yml so it has the access information for the database (production, we skipped test and dev)
Load the application using mod_passenger
Add the following to the custom vhost config for the domain (you may have to create the directory structure)
edit /usr/local/apache/conf/userdata/std/2/username/domain.com/redmine.conf
Next, add this to /etc/httpd/conf/includes/post_virtualhost_global.conf
Look up your vhost in /etc/httpd/conf/httpd.conf and look for the line:
Uncomment the include line, and restart Apache to verify it works fine. Once restarted OK, distill it to the distiller:
Your redmine application should now be accessible at http://domain.com
The default login is admin / admin
NOTE: This requires that you have already followed my guide on installing Rails 3.x and mod_passenger for Apache. The latest version of Redmine (2.x) is no longer compatible with Rails 1.x/2.x. If you need to install just Redmine 1.x, the normal methods will work with cPanel's default Ruby/RoR setup.
NOTE: This is highly unsupported. Following this script will guarantee a clean install, but I am not very experienced with Rails applications.
NOTE: This guide also assumes that you will be running Redmine directly at the root of a domain or subdomain vhost in cPanel. Note that all of the rails files need to be one directory above the DocumentRoot for your virtual host, and the 'public' directory within the rails app needs to be moved to the real DocumentRoot. You can create a symbolic link to accomplish this. The examples I use below are for if Redmine is installed to the root of a main domain.
Installing Redmine
If a cPanel account doesn't exist, create one. Then create a database and user in WHM named username_redmine and assign the user to the DB
The following will calibrate your shell session and install improved MySQL support for Ruby Gems along with the bundler application the redmine install process uses
Code:
shopt -s dotglob
gem install mysql2
gem install bundler
Code:
cd /usr/local/src
wget http://rubyforge.org/frs/download.php/XXXXX/redmine-version.tar.gz
tar -xzvf redmine-version.tar.gz
chown -R username:username /usr/local/src/redmine-version/*
mv /usr/local/src/redmine-version/* /home/username/
Below, you are moving the webroot portion of the rails app to your document root for the cPanel account, and then creating a symlink so Rails is none the wiser
Code:
mv /home/username/public/* /home/username/public_html
rm -rf /home/username/public
ln -s /home/username/public_html /home/username/public
Code:
cd /home/username
bundle install --without development test postgresql sqlite
cp /home/username/config/database.yml.example /home/username/config/database.yml
Code:
cd /home/username
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
Add the following to the custom vhost config for the domain (you may have to create the directory structure)
Code:
mkdir -p /usr/local/apache/conf/userdata/std/2/username/domain.com
Code:
PassengerSpawnMethod smart
PassengerPoolIdleTime 300
PassengerMaxPreloaderIdleTime 0
PassengerMaxRequests 5000
PassengerStatThrottleRate 5
PassengerMinInstances 3
<Location />
Options Indexes -ExecCGI FollowSymLinks -MultiViews
# AllowOverride None
Order allow,deny
Allow from all
# mod_rails
# PassengerUser redmine
#RailsEnv edoceo_live
RackBaseURI /
# environment.rb
# Redmine::Utils::relative_url_root = "/"
</Location>
Code:
PassengerPreStart http://domain.com
Code:
# To customize this VirtualHost use an include file at the following location
# Include "/usr/local/apache/conf/userdata/std/2/username/domain.com/*.conf"
Code:
/usr/local/cpanel/bin/apache_conf_distiller --update
/usr/local/cpanel/bin/build_apache_conf
The default login is admin / admin