Blogs
Install the Backlogs plugin for Redmine on Hostgator
Backlogs is one of the best plugins for Redmine. It allows you to work in an agile way by creating stories, tasks and displaying beautiful charts showing the project's progress.
Installing Backlogs is quite easy. It gets a little bit complicated when you try to install it in the restrictive environment of a shared hosting provider like Hostgator. But it can be done.
Pre-requirements
Before we start, you need to enable SSH access for your Hostgator account. If you don't know how to do it, follow the instructions from my previous post:
Enable SSH access on a Hostgator shared hosting account
Of course you need an installation of Redmine. If you need help installing Redmine on Hostgator, check out this post:
Install Redmine on Hostgator shared hosting
Configure a local gem repository
Backlogs requires a few gems to run properly. But on a shared hosting account you can't install gems in the standard gem repository location. The solution is to specify a non-standard gem repository location via the GEM_HOME environment variable.
You can do that by editing the .bash_profile
vim ~/.bash_profile
And adding the following line:
export GEM_HOME=$HOME/ruby/gems
Right now Redmine knows only about the global gem repository. To inform it about your local repository, edit the configuration file ~/apps/redmine/config/environment.rb and add the following lines:
$:.push("/home/your-account/ruby/gems") ENV['GEM_PATH'] = '/home/your_account/ruby/gems:/usr/lib/ruby/gems/1.8'
Install the needed gems
Some of the gems are already available in the global repository on the Hostgator servers and you don't need to install them:
- rubygems
- rails
- rack
The rest of the gems can be installed in the local repository by running the following command:
gem install i18n icalendar prawn open-uri-cached system_timerAnother gem you need is holidays. But installer of the latest version (1.0.4) has a known problem. The workaround is to first install an older version and then update to the latest one:
gem install holidays --version 1.0.3 gem install holidays
You also need to install the nokogiri gem. But it needs to compile some native extensions and this can't be achieved on the Hostgator server.
Compile nokogiri
The solution is to compile the gem and its native extensions on a different machine where you have access to a compiler. Then pack the gem together with the native extensions and install it in the local gem repository on the Hostgator server.
Before getting to the compilation part, make sure you have installed both libxml2 and libxslt libraries in the /opt/ folder of your build machine, just like on the Hostgator server.
In order to generate gems with pre-packed native extensions we need to install the gem-compiler gem that helps us compile other gems:
gem install gem-compilerNext, download the nokogiri gem without installing it:
gem fetch nokogiri
This will download the gem file nokogiri-1.5.0.gem in the current folder.
Now you can simply compile the nokogiri package, specifying the custom locations for the libxml2 and libxslt libraries:
gem compile nokogiri-1.5.0.gem -- \ --with-xml2-lib=/opt/xml2/lib/ \ --with-xml2-include=/opt/xml2/include/libxml2/ \ --with-xslt-lib=/opt/xslt/lib/ \ --with-xslt-include=/opt/xslt/include/
This will create the gem file nokogiri-1.5.0-x86-linux.gem with precompiled native extensions. Upload the gem file to the Hotgator server and install it:
gem install nokogiri-1.5.0-x86-linux.gemIf you don't want to get through all the trouble of compiling the nokogiri gem yourself, just download the package I've attached to this post.
Install Backlogs
You have to download the Backlogs source code in the vendor/plugins of your Redmine installation on the Hostgator server. I prefer to use git for this.
cd ~/apps/redmine/vendor/plugins/ git clone git://github.com/relaxdiego/redmine_backlogs.git
If you want to install git on a Hostgator shared hosting account check my previous post:
Install Git on Hostgator shared hosting
This will create a directory named redmine_backlogs. Next we have to take a look at the available versions and choose the latest one available.
cd redmine_backlogs git tag git checkout v0.8.1
Now ensure your Redmine instance is set-up correctly by running the following rake commands in the Redmine installation directory.
cd ~/apps/redmine/ rake generate_session_store rake config/initializers/session_store.rb rake db:migrate rake db:migrate:upgrade_plugin_migrations
Next step is to configure Backlogs:
cd ~/apps/redmine/ rake redmine:backlogs:install
That's all, have fun!
Install Redmine on Hostgator shared hosting
Pushing the limits of the shared hosting account at Hostgator again. This time I've decided to install Redmine in order to track the progress of my private projects.
The nice thing about Hostgator is that they offer, besides the standard PHP, the increasingly popular Python and Ruby on Rails. And this can prove quite handy if you want to do more with your hosting than the average Wordpress and Drupal installs.
Enable the SSH access
The first step is to enable the SSH access for your Hostgator account. If you don't know how to do it, you can read my previous article about this subject:
Enable SSH access on a Hostgator shared hosting account
Create a database
You need a database for your Redmine instance. You can easily create one using the cPanel interface for your Hostgator account. Note the details of the database, as you'll need them later.
Configure the environment
Edit .bash_profile and set the RAILS_ENV to the production environment.
vim ~/.bash_profile
Add the following line:
export RAILS_ENV=production
Install Redmine
Create a folder for the Redmine application:
mkdir ~/apps/
Download the latest stable Redmine code from Subversion:
cd ~/apps/ svn co http://redmine.rubyforge.org/svn/branches/1.3-stable redmine
Configure the database
Configure the database details. You can use a template file provided with the code:
cd ~/apps/redmine/ cp config/database.yml.example config/database.yml
Open the file and edit the details of the production section by entering the details of the database created in the beginning of the post.
Initialize the database:
rake config/initializers/session_store.rb rake db:migrate rake redmine:load_default_data
Specify the environment
Open the Redmine environment file:
vim ~/apps/redmine/config/environment.rb
And set the RAILS_ENV variable to production like this:
ENV['RAILS_ENV'] = 'production'
Enable all the dispatch scripts:
cd ~/apps/redmine/public/ cp dispatch.cgi.example dispatch.cgi cp dispatch.fcgi.example dispatch.fcgi cp dispatch.rb.example dispatch.rb
Copy the .htaccess file for CGI dispatch configuration:
cp htaccess.fcgi.example .htaccessMake the Redmine application available
The folder where we installed Redmine is not accessible to the apache web server. To remedy this, we can create a symbolic link in the /home/kenjiru/public_html folder to the redmine/public/ folder.
ln -s /home/kenjiru/apps/redmine/public /home/kenjiru/public_html/redmine
Now Redmine will be accessible as a folder in the main domain, like kenjiru.ro/redmine. You can also create a subdomain and point it to the redmine folder, for a result like this redmine.kenjiru.ro.
Install Git on Hostgator shared hosting
Introduction
After hearing my colleagues talking today about how cheap the VPS got in the last few years, I almost convinced myself that I have to switch. But I've decided to give my old shared hosting package from Hostgator another try. Buying a VPS package only to install Git is not the smartest thing to do, as you can get better and cheaper services from source code hosting providers like github.com or bitbucket.org.
Enable the SSH access
Enabling SSH access for a Hostgator access is really simple. You can learn more about it by reading my article about this subject:
Enable SSH access on a Hostgator shared hosting account
Install git
Git won't be available system wide, and you can't install it from source either. You can't compile Git remotely, because you won't have access to a compiler from within the jail shell. The only option left is to compile the git package from sources on a different machine with the same configuration as the one used by Hostgator for its shared hosting packages.
After a little research I've found that Hostgator is using CentOS 5.5, the 32 bit version. If you don't have a CentOS machine available, you can download a preinstalled Vmware image or you can install the system yourself. If you want to go the "do it yourself" way, then check my previous posts about installing CentOS 5.x and compiling Git:
If you just want to get to the next step quickly, just download the binary package attached to this post. It was compiled on a 32 bit version of CentOS 5.7.
Upload the binary package to Hostgator and unzip it somewhere in your home folder. I've called it /home/kenjiru/apps in my case.
Setup the environment
The last step is to let the shell know about the location of the git binary. You can do that by editing the ~/.bash_profile and appending the location of the git distribution to the PATH environment variable.
PATH=$PATH:/home/kenjiru/apps/git/bin
Give it a try
Now you can use Git as you would normally do on your machine. On the remote server you can issue commands like:
git clone git@github.com:kenjiru/test.git
You can also push to a remote repository hosted on the shared hosting. You will have to additionally specify the custom port that Hostgator uses like this:
git remote add origin ssh://kenjiru@kenjiru.ro:2222/~/git/test.git
Also notice the format of the remote path.
That's pretty much all. I hope this tutorial helped you.
Enable SSH access on a Hostgator shared hosting account
Hostgator always had the option to enable the SSH access to your shared hosting account. But only recently I've noticed how is to enable it. First time when I tried to activate the SSH access, they were requiring a scan your ID card with a clear photo on it. That proved to be too much for me.
Getting back to the subject, Hostgator provides free SSH access to a Jail Shell environment, but you have to explicitly enable this feature. Connect to gbclient.hostgator.com with your billing username and password, click on "View Hosting Packages" and then select the "Enable Shell Access" option. This will instantly enable the SSH access for your account. Now you can connect using your primary domain attached to your hosting package and the username and password you use to access cPanel.
Another thing to remember is that Hostgator uses the 2222 custom port for the SSH access. You can specify the custom port like this:
ssh -p 2222 user@domain.com scp /local/path/file -P 2222 user@domain.com:/remote/path
Install Git from source on CentOS 5.x
The simplest way to install Git is from the EPEL repository. You can add the EPEL repository by following my previous post on this subject: Adding the EPEL repository to CentOS 5.x.
But if you need, for some reason, to install Git from source, then you'll have to follow these instructions
Upgrade the system
It's always a good thing to have the latest packages:
yum -y upgrade
Install the needed packages for compilation
yum install gcc zlib-devel curl-devel
You'll need zlib-devel if you want to use http/https/webdav access to Git repositories.
Build Git from source
Download the sources and untar:
wget http://git-core.googlecode.com/files/git-1.7.8.4.tar.gz tar xvzf git-1.7.8.4.tar.gz
Configure and set the prefix, if you want something more exotic. And in the last step, build the thing:
./configure --prefix=/usr/ make make install
That's all!
