Web Hosting Talk







View Full Version : Installing Redmine+git on ubuntu 11.04 x64 VPS


paperwastage
01-08-2012, 05:32 PM
Installing Redmine+git on ubuntu 11.04 x64 VPS

Version Control System + wiki/other stuff

Following the tutorial below with some modification
http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/

Requirements:
VPS
I used ubuntu 11.04 x64 as it was the latest version of ubuntu and I'm more familiar with this distro than others
RAM: at least 512MB, preferable more as Ruby/Rails takes up a lot

First, upgrade everything in your clean VPS. (mine came with apache2 preinstalled). I suggest making ssh-keys and installing fail2ban to prevent attacks. Everything I'm running through root

apt-get update
apt-get upgrade


Download the latest version from http://www.redmine.org/. The one I'm using is stable 1.3.0(2011-12-10).

cd /root #(or whatever directory you want)
wget http://rubyforge.org/frs/download.php/75597/redmine-1.3.0.tar.gz
tar xvf redmine-1.3.0.tar.gz
chown -R root:root redmine-1.3.0 #had to fix permissions for my vps


Take a look at the Redmine Install Requirements (http://www.redmine.org/projects/redmine/wiki/RedmineInstall)

Install the packages (from the tutorial (http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/), modifying a little based on the install requirements. Here (http://packages.ubuntu.com/natty/allpackages) is a list of the packages for 11.04 natty. I choose Ruby 1.8.7, Rails 2.3.14 and Rack 1.1.1

apt-get install ruby ruby1.8 ruby1.8-dev libgemplugin-ruby libgemplugin-ruby1.8 apache2-mpm-prefork libruby-extras libruby1.8-extras rake apache2-prefork-dev libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl build-essential libcurl4-openssl-dev

apt-get install mysql-server libmysqlclient15-dev #make sure you set and remember the mysql root password


Create database

mysql -u root -p

CREATE DATABASE redmine_default CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'thisismyredminesqlpassword';
GRANT ALL privileges ON redmine_default.* TO 'redmine'@'localhost';


I moved my redmine folder to /usr/share/redmine/

mv /root/redmine-1.3.0 /usr/share/redmine/


Config the redmine installation

cp /usr/share/redmine/config/database.yml.example /usr/share/redmine/config/database.yml


Edit that database.yml

production:
adapter: mysql
database: redmine_default
host: localhost
username: redmine
password: thisismyredminesqlpassword
encoding: utf8


NOTE: tutorial says to install rubygems on your own since the 11.04 repo contains an older version. i didnt care, used the older version

apt-get install rubygems rubygems1.8


Install Rails + Rack. Remember that I chose Ruby 1.8.7, Rails 2.3.14 and Rack 1.1.1 earlier.

gem install rails -v=2.3.14
gem install rack -v=1.1.1
gem install mysql
gem install -v=0.4.2 i18n

Got some "No definition for ..." errors, but they are from the documentation installation. didnt care too much, google could show ways to solve it

Configure Redmine

cd /usr/share/redmine
mkdir public/plugin_assets #had to do this
chown -R www-data:www-data files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
chmod -R 777 public/plugin_assets
rake generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data


Test Redmine at http://ip:3000

ruby script/server webrick -e production


------------

Set up apache2

Install passenger. Link your redmine public folder to /var/www

gem install passenger
apt-get install libapache2-mod-passenger
ln -s /usr/share/redmine/public /var/www/redmine


Configure apache. Edit file /etc/apache2/sites-available/redmine.mydomainname.com

<VirtualHost *:80>
ServerName redmine.mydomainname.com

DocumentRoot /var/www/

PassengerDefaultUser www-data
RailsEnv production
RailsBaseURI /redmine
SetEnv X_DEBIAN_SITEID "default"
<Directory /var/www/redmine/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Edit /etc/apache2/apache2.conf. Add to bottom of file

Include /etc/apache2/mods-available/passenger.conf


Activate your site

ln -s /etc/apache2/sites-available/redmine.mydomainname.com /etc/apache2/sites-enabled/redmine.mydomainname.com


Remove default entry

rm /etc/apache2/sites-enabled/000-default


Restart Apache and it should work

service apache2 restart


--------------------

Installing Git/gitosis
< to be continued >

8088
01-08-2012, 05:48 PM
Or:apt-get install redmine

paperwastage
01-08-2012, 06:57 PM
Or:apt-get install redmine

redmine (1.0.5-1) [universe]
flexible project management web application\

vs latest redmine 1.3.0 stable

huh.. you'll be missing some features/bug fixes etc
http://www.redmine.org/projects/redmine/wiki/Changelog

8088
01-08-2012, 07:17 PM
That contradicts i didnt care, used the older version
;-)

Also: http://packages.ubuntu.com/precise/redmine

paperwastage
01-08-2012, 07:31 PM
That contradicts
;-)

Also: http://packages.ubuntu.com/precise/redmine

well, one package of rubygems(that would still work with 1.3.0) vs an older version of a big package redmine

and precise = 12.04LTS.. sure, you can try to do it yourself or even use BitNami Redmine Stack, but I prefer to learn how systems interact... and this guide is a backup for myself in case I need to do it again....