Index by title

Add mysql database for Redmine

The easy way to add a mysql database is trough the admin console.

1: Start the MySQL® Database Wizard



2: Choose database name



3: Choose database user and password



4: Add all privileges to that user to that database



All done.


Add a subdomain to your BlueHost domain

The only way to add a subdomain is trough the admin console.

1: Choose Subdomains in your BlueHost admin console


2: Enter your sub domain name and path to the document root NB. the default needs /public added


All done.


BlueHost setup

Wiki for howto's and other stuff regarding the BlueHost setup we use

Installation Howto's

Forums for the Howto's


Cronjob

We will now create the cronjob for refreshing the Redmine database from our repository
This needs to be done on BlueHost, as I haven't gotten the "auto-pulling" from the repository to work.
For your own installation you need to change all that is in this format

commands to run directly from the prompt is in this format (of course, after changing the values )

Tasks:

  1. Create a cronjob
  2. Set up cronjob in BlueHost control panel

Create a cronjob

cd
mkdir bin
echo '#!/bin/bash' > ~/bin/myRedmineCronjob
echo 'cd ~/public_html/redminedemo' >> ~/bin/myRedmineCronjob
echo '/ramdisk/bin/ruby script/runner "Repository.fetch_changesets" -e production' >> ~/bin/myRedmineCronjob
chmod 700 ~/bin/myRedmineCronjob


Set up a cronjob in BlueHost cPanel

The only way to add a cronjob is trough the cPanel.

1: Choose Cron jobs in your BlueHost cPanel

2: Choose advanced

3: Enter the values as shown (Replace USERNAME with your Bluehost username)


All done.

The only thing remaining is to check that you see your changesets from your repository in the project you made.


Google analytics installation

After installing Redmine on BlueHost, it's time to add a plugin.
This installation requires the Redmine setup used here
The plugin hompage is here

commands to run directly from the prompt is in this format

So, here is what I did:
cd ~/public_html/redminedemo
ruby script/plugin install http://svn.rails-engines.org/engines/tags/rel_2.0.0/
mv vendor/plugins/rel_2.0.0 vendor/plugins/engines
cd ~/public_html/redminedemo/vendor/plugins
wget https://projects.littlestreamsoftware.com/attachments/download/154/google_analytics_plugin.tar.gz
tar zxvf google_analytics_plugin.tar.gz
rm google_analytics_plugin.tar.gz
sed 's|Redmine::Hook::ViewListener|Rails::Plugin|g' google_analytics_plugin/lib/google_analytics_hooks.rb > TMPFILE && mv TMPFILE google_analytics_plugin/lib/google_analytics_hooks.rb
cd ~/public_html/redminedemo
rake db:migrate_plugins RAILS_ENV="production"

That's it. You will now find your plugin listed in the Settings section of Administration on your Redmine site.


Installation of Mercurial (Hg) on BlueHost

This is a guide on how to install Mercurial to your BlueHost site.
The guide is mostly written as a reminder to myself on how I did it. If you use this guide and want changes or other features, you could use the forum or google
Basic Authentication is used for the repositories (normal linux password file)

commands to run directly from the prompt is in this format (of course, after changing the values that needs changing )
text to enter or edit in files is in this format
Text you need to change is in this format

Before you start:

You need ssh access to your BlueHost account and you should also know how to use nano (or any other text editor from command line)

  1. Update your .bash_profile file
  2. Update your .bashrc file

1. Update your .bash_profile file (and add/modify these 3 lines)

nano ~/.bash_profile

Enter these 3 lines, or edit them if you find them there already
export LD_LIBRARY_PATH="$HOME/packages/lib:$LD_LIBRARY_PATH"
export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages:$PYTHONPATH"
export PATH="$HOME/packages/bin:$HOME/bin:$PATH"

source ~/.bash_profile

2. Update your .bashrc file

nano ~/.bashrc

Add or edit this line
PATH=$PATH:$HOME/bin:$HOME/packages/mercurial

source ~/.bashrc


Mercurial installation:

1.Get mercurial and install

This part does everything except initializing the repository, creating the password file and initialize the projects

cd
mkdir install_files
mkdir packages
mkdir ~/public_html/hg
mkdir ~/public_html/hg/repos
cd ~/packages
wget http://www.selenic.com/mercurial-stable-snapshot.tar.gz
tar zxf mercurial-stable-snapshot.tar.gz
mv mercurial-stable-snapshot.tar.gz ~/install_files/
mv mercurial* mercurial
cd mercurial
make local
./hg debuginstall
cp ~/packages/mercurial/hgwebdir.cgi ~/public_html/hg
chmod 755 ~/public_html/hg/hgwebdir.cgi
sed 's|#import sys|import sys|g' ~/public_html/hg/hgwebdir.cgi > TMPFILE && mv TMPFILE ~/public_html/hg/hgwebdir.cgi
sed 's|#sys.path.insert(0, "/path/to/python/lib")|sys.path.insert(0, "/home/'$USER'/packages/mercurial")|g' ~/public_html/hg/hgwebdir.cgi > TMPFILE && mv TMPFILE ~/public_html/hg/hgwebdir.cgi
echo [collections] > ~/public_html/hg/hgweb.config
echo /home/$USER/public_html/hg/repos = /home/$USER/public_html/hg/repos >> ~/public_html/hg/hgweb.config
echo [web] >> ~/public_html/hg/hgweb.config
echo allowpull=true >> ~/public_html/hg/hgweb.config
echo 'Options +ExecCGI' > ~/public_html/hg/.htaccess
echo 'RewriteEngine On' >> ~/public_html/hg/.htaccess
echo 'RewriteBase /'~$USER'/hg' >> ~/public_html/hg/.htaccess
echo 'RewriteRule ^$ hgwebdir.cgi [L]‘ >> ~/public_html/hg/.htaccess
echo ‘RewriteCond %{REQUEST_FILENAME} !-f’ >> ~/public_html/hg/.htaccess
echo ‘RewriteCond %{REQUEST_FILENAME} !-d’ >> ~/public_html/hg/.htaccess
echo ‘RewriteRule (.*) hgwebdir.cgi/$1 [QSA,L]‘ >> ~/public_html/hg/.htaccess
echo ‘AuthUserFile /home/’$USER’/etc/hg-basic-auth’ >> ~/public_html/hg/.htaccess
echo ‘AuthName “HG Repositories”‘ >> ~/public_html/hg/.htaccess
echo ‘AuthType Basic’ >> ~/public_html/hg/.htaccess
echo ‘Require valid-user’ >> ~/public_html/hg/.htaccess
cd ~/public_html/hg/repos

2. Initialize the mercurial repository

You need to change REPOSITORY to your repository name
If you want more than one repository, run the command for each of them

~/packages/mercurial/hg init REPOSITORY

3. Create password file

You need to change the values of HGUSERNAME and PASSWORD to your wanted user name and password

cd
htpasswd -b -c -d ~/etc/hg-basic-auth HGUSERNAME PASSWORD

For extra users (also change HGUSERNAME and PASSWORD )

htpasswd -b -d ~/etc/hg-basic-auth HGUSERNAME PASSWORD

4. Create hgrc files for each project

You need to change:
PROJECTNAME to your project name (due to limitations in this wiki, I can't get the coloring totally correct)
The line MYPROJECT="PROJECTNAME" should look like this (without the spaces) MYPROJECT=" PROJECTNAME "
ADMIN EMAIL to your project admin email
DESCRIPTION to your project description
USER1 ... USERn to your repository user(s) name(s)
If you are the only user, the line should be echo 'allow_push=USER1' >> ~/public_html/hg/repos/PROJECT/.hg/hgrc

cd
MYPROJECT="PROJECTNAME"
echo '[web]' > ~/public_html/hg/repos/$MYPROJECT/.hg/hgrc
echo 'contact=ADMIN EMAIL' >> ~/public_html/hg/repos/$MYPROJECT/.hg/hgrc
echo 'description=DESCRIPTION' >> ~/public_html/hg/repos/$MYPROJECT/.hg/hgrc
echo 'allow_push=USER1, USERn' >> ~/public_html/hg/repos/$MYPROJECT/.hg/hgrc
echo 'allow_archive=zip' >> ~/public_html/hg/repos/$MYPROJECT/.hg/hgrc


And that's how I installed Mercurial on BlueHost



Installation of Redmine on BlueHost

This is a guide on how to install Redmine to your BlueHost site.
The guide is mostly written as a reminder to myself on how I did it. If you use this guide and want changes or other features, you could use the forum or google
The version of Redmine used here is the current one as of writing this howto.

Tasks:

  1. Add mysql database Moved to its own wiki page for a visual walk trough :-)
  2. Add a subdomain Moved to its own wiki page for a visual walk trough :-)
  3. Download Redmine and configure (this page)
  4. Redmine confiuration is the last part of this howto. Here we'll link our repository into Redmine
  5. Create a cronjob to automatically populate your Redmine database with the changesets from Mercurial

For this how to, I use (as you see in the Add mysql database page)
database name: gttoolsc_demo
username: name gttoolsc_demo
password: +?zP5A8a
subdomain: redminedemo (as you see in the Add a subdomain page)
For your own installation you need to change all that is in this format

commands to run directly from the prompt is in this format (of course, after changing the values )


Ok, here is the installation of Redmine on Bluehost

cd
mkdir ~/public_html/redminedemo
cd ~/public_html/redminedemo
wget http://rubyforge.org/frs/download.php/39477/redmine-0.7.3.tar.gz
tar zxvf redmine-0.7.3.tar.gz
rm redmine-0.7.3.tar.gz
mv redmine-0.7.3/* .
rmdir redmine-0.7.3
echo production: > ~/public_html/redminedemo/config/database.yml
echo ' adapter: mysql' >> ~/public_html/redminedemo/config/database.yml
echo ' database: gttoolsc_demo '>> ~/public_html/redminedemo/config/database.yml
echo ' host: localhost' >> ~/public_html/redminedemo/config/database.yml
echo ' username: gttoolsc_demo '>> ~/public_html/redminedemo/config/database.yml
echo ' password: +?zP5A8a '>> ~/public_html/redminedemo/config/database.yml
echo ' encoding: utf8' >> ~/public_html/redminedemo/config/database.yml
mv ~/public_html/redminedemo/public/dispatch.fcgi.example ~/public_html/redminedemo/public/dispatch.fcgi
chmod 700 ~/public_html/redminedemo/public/dispatch.fcgi
chmod 700 ~/public_html/redminedemo/tmp
chmod 700 ~/public_html/redminedemo/log
sed 's|# ENV\[|ENV\[|g' config/environment.rb > TMPFILE && mv TMPFILE config/environment.rb
sed 's|\:domain => "somenet.foo",|\:domain => "yourdomain.com",|g' config/environment.rb > TMPFILE && mv TMPFILE config/environment.rb
sed 's|\:user_name => "redmine@somenet.foo",|\:user_name => "mailuser@yourdomain.com",|g' config/environment.rb > TMPFILE && mv TMPFILE config/environment.rb
sed 's|\:password => "redmine",|\:password => "password for mailuser@yourdomain.com",|g' config/environment.rb > TMPFILE && mv TMPFILE config/environment.rb
rake db:migrate RAILS_ENV="production"
rake redmine:load_default_data RAILS_ENV="production"
Choose your default language when prompted (or press Return to accept English).

Now the Redmine site is operational.

You may now login to your site (http://redminedemo.yourdomain.com ):


You should also follow this howto for configuring mercurial for your Redmine


Redmine configuration

This is a guide on how to configure Redmine to your BlueHost site and get it working with your Mercurial repository.
The guide is mostly written as a reminder to myself on how I did it. If you use this guide and want changes or other features, you could use the forum or google

Tasks:

  1. Logon
  2. Set repositories values
  3. Add a project
  4. Link repository to the project
  5. Create a cronjob to get the updating automatically

1.Logon

Browse to your new redmine installation, press the "Sign in"

Enter the logon information


2.Set repositories values

Press the "Administration"

Then "Settings"

Then "Repositories"

Add encoding and choose "Closed" as "Applied status"


3.Add a project

Go back to the "Administration" again and choose New (project)

Enter name and identifier for your project. Click Save

Click on your new project


Click "Settings" and then "Repository"

Choose Mercurial as SCM and enter the path to your repository (change USERNAME and REPOSITORY)


That's it

However, to populate the Redmine database from your repository, you need to mak a cronjob.