This article assumes that you have a basic understanding of command line interfaces. First we
1) First we need to check our gemrc file to ensure that our environment is setup.
To do this, run the following command:
nano .gemrc |
It should look similar to:
--- gem: --no-ri --no-rdoc gemhome: /home/USERNAME/.gems gempath: - /home/USERNAME/.gems - /usr/lib/ruby/gems/1.8 :benchmark: false :update_sources: true :verbose: false :backtrace: false :sources: - http://gems.rubyforge.org/ - http://rubygems.org/ :bulk_threshold: 1000 |
Make sure that you replace USERNAME with your username.
2) We also need to check our bash_profile for the same reason.
Run the following command:
nano .bash_profile |
It should look similar to:
# START if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$HOME/.gems/bin:$HOME/bin:$PATH GEM_HOME=$HOME/.gems GEM_PATH=$HOME/.gems:/usr/lib/ruby/gems/1.8 export PATH GEM_HOME GEM_PATH # END |
3) If we make any changes to the bash_profile, we need to source it so that the changes are picked up.
source ~/.bash_profile |
4) Next we need to make the directory we are going to install redmine in.
mkdir redore |
5) Now lets move into that directory.
cd redore |
6) Now we need to get the actual redmine files. You can do this by running the following command.
svn co http://svn.redmine.org/redmine/branches/2.1-stable redmine-2.1 |
7) Now lets move into that folder.
cd redmine-2.1 |
8) Now lets install bundler…
gem install bundler |
9) Now we need to get all the other things redmine is going to need.
bundle install --without development test sqlite postgresql --path vendor/bundle |
10) Now you need to log into your control panel and create the database/user that will be used by redmine.
11) Once you have created your database, its time to start editing the config file
cd config |
Next we need to copy the sample database config file.
cp database.yml.example database.yml |
Next lets edit the file and add out connection details.
nano database.yml |
We only need to edit the production section. It should look similar to the following:
production: adapter: mysql database: username_database host: localhost username: username_dbuser password: password encoding: utf8 |
12) Time to move back up a directory…
cd .. |
13) Time to generate our secret token…
bundle exec rake generate_secret_token |
14) Lets populate our database with all the information it needs.
RAILS_ENV=production bundle exec rake db:migrate |
…and…
RAILS_ENV=production bundle exec rake redmine:load_default_data |
Now enter your language, then hit enter.
15) Time to move down to our public directory…
cd public |
16) Now we need to make a .htaccess file:
touch .htaccess |
17) Now we need to edit said htaccess:
nano .htaccess |
We need to add the following to it:
PassengerEnabled On PassengerAppRoot /home/USERNAME/redore/redmine-2.1 |
Make sure you replace USERNAME with your account username.
18) Now we need to move back up a directory
cd .. |
19) Lets restart the application…
touch tmp/restart.txt |
20) Now lets move to our root directory…
cd ~/ |
21) Here is where we setup the symbolic link or domain path that will point to our redmin install. Follow the section that fits your install needs.
Primary Domain Base
If you wish to have redmin appear in the root of your domain (http://example.com/) use the following steps.
Please Note: This will remove all data currently inside of your public_html folder. If you host other sites that currently reside inside of the public_html folder, it will all be deleted using this step. Use at your own risk!
rm -rf public_html/ |
Now to create the link itself…
ln -s ~/redore/redmine-2.1/public public_html |
Base of Sub-Domain/Addon Domain
For sub-domains and addon domains, you can simply modify the “Website Folder” option when editing the domain. You can point it to the following…
redore/redmine-2.1/public |
Sub-Folder
If you would like to install redmine to a sub-folder (eg. http://example.com/redmine), we will need to use a symbolic link. We will also need to add an extra line to our htaccess file we created earlier.
Add the following to the htaccess file:
RailsBaseURI /redmine |
Where redmine would be the subfolder we are using.
Next to create the link. We need to do this from the base folder of the domain. For example, if we want to install to http://example.com/redmine, we would need to be in the folder that example.com uses (normally public_html).
ln -s ~/redore/redmine-2.1/public redmine |