Redmine as Debian package:
- The core package is
redmine
. Three packages (redmine-*
) provide correct dependencies formysql
,pgsql
,sqlite
. - Several configurations are given as working examples in
/usr/share/doc/redmine/examples
. - Explanations of how the configuration is dealt with are given in
/usr/share/doc/redmine/README.Debian.gz
. - There is no per-instance support for plugins, but those dropped to
/usr/share/redmine/vendor/plugins
.
Manual and Up-To-Date Installation
Install requirements:
apt-get update apt-get install git-core apache2 rubygems libopenssl-ruby libmysql-ruby libapache2-mod-fcgid libapache2-mod-passenger ruby mysql-server cron libnet-ssh-ruby1.8 python-setuptools # If you like to use Gant-Charts (an additional ~40 MiB on my headless server): apt-get install librmagick-ruby1.8 # Enable new apache modules: a2enmod fcgid a2enmod passenger # Install the rails version needed (not the latest 2.3.x rails): gem install -v=2.3.5 rails # Link the rake version (that came with rails) to /usr/local/bin (may need to be adjusted to your version of rake): ln -s /var/lib/gems/1.8/gems/rake-0.9.0/bin/rake /usr/local/bin/rake
Create the database:
DBNAME=redmine_code DBUSER=redminecode DBPASSWORD=`pwgen -n1` cat << EOF | mysql -uroot -p CREATE DATABASE $DBNAME CHARACTER SET utf8; CREATE USER '$DBUSER'@'localhost' identified by '$DBPASSWORD'; GRANT ALL PRIVILEGES ON $DBNAME.* TO '$DBUSER'@'localhost'; EOF echo "The database user $DBUSER has been assigned the password $DBPASSWORD. Please remember the password."
Get redmine:
cd /var/lib git clone https://github.com/edavis10/redmine.git cd /var/lib/redmine git checkout -b 1.1.3 1.1.3 # set the configuration cat << EOF > config/database.yml production: adapter: mysql database: $DBNAME host: localhost username: $DBUSER password: $DBPASSWORD encoding: utf8 schema_search_path: public" > config/database.yml EOF
Initialize the installation:
RAILS_ENV=production rake config/initializers/session_store.rb rake generate_session_store RAILS_ENV=production rake db:migrate RAILS_ENV=production rake redmine:load_default_data
Set up Apache for redmine:
ADMINMAIL=your.address@example.com DOMAIN=code.example.com APACHEUSER=code-www adduser $APACHEUSER cat << EOF > /etc/apache2/sites-available/$DOMAIN.redmine <VirtualHost *> ServerAdmin $ADMINMAIL ServerName $DOMAIN # If suexec-custom or suexec apache module is loaded, you can specify a special user: SuexecUserGroup $APACHEUSER $APACHEUSER DefaultInitEnv RAILS_ENV production DefaultInitEnv GEM_PATH /var/lib/gems/1.8 DocumentRoot /var/lib/redmine/public <Directory /var/lib/redmine/public> Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteRule ^\$ index.html [QSA] RewriteRule ^([^.]+)\$ \$1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)\$ dispatch.fcgi [QSA,L] ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" AllowOverride None #AllowOverride all Order allow,deny allow from all </Directory> # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn CustomLog /var/log/apache2/$DOMAIN.access.log combined ErrorLog /var/log/apache2/$DOMAIN.error.log ServerSignature Off </VirtualHost> EOF a2ensite $DOMAIN.redmine # Passenger will be run as the owner of config/environment.rb: chown $APACHEUSER: config/environment.rb chmod 666 /var/lib/redmine/log/production.log chown -R $APACHEUSER: files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets /etc/init.d/apache2 reload
You may now log in with username admin
and password: admin
.
Git integration:
apt-get install libnet-ssh-ruby1.8 python-setuptools gitosis git-daemon-run acl gem install inifile lockfile net-ssh # Loop file as repository storage LOOPFILE=/root/repository-storage dd if=/dev/zero of=$LOOPFILE bs=1M count=1024 mkfs.ext3 `losetup -j $LOOPFILE | cut -d ':' -f 1` > ~root/repository-storage.about.mkfs.ext3 2>&1 mount -o acl `losetup -j $LOOPFILE | cut -d ':' -f 1` /mnt mv /srv/* /mnt umount /mnt echo "$LOOPFILE /scr ext3 defaults,loop,acl 0 0" >> /etc/fstab mount /srv echo "ssh-keygen -t dsa" | su gitosis echo "cat ~gitosis/.ssh/id_dsa.pub | gitosis-init" | su gitosis sed -i.orig 's:/var/cache:/srv/gitosis:g' /etc/sv/git-daemon/run sv restart git-daemon setfacl -m user:$APACHEUSER:r-x,mask:r-x ~gitosis/.ssh setfacl -m user:$APACHEUSER:r--,mask:r-- ~gitosis/.ssh/id_dsa cd /var/lib/redmine # check <https://github.com/xdissent/redmine_gitosis/network> for inspiration which to choose... script/plugin install git://github.com/xdissent/redmine_gitosis.git echo "X_DEBIAN_SITEID=default RAILS_ENV=production rake db:migrate:plugins" | su $APACHEUSER /etc/init.d/apache2 restart
Open your Browser, got to my_domain and login. Go to Administration → Plugins → Configure Redmine Gitosis plugin.
Change localhost
to code.example.com
.
Change xdissent.com
to code.example.com
.
Resources
- Debian Package: http://packages.debian.org/de/squeeze/redmine
- A quite recent Guide: http://library.linode.com/web-applications/project-management/redmine/debian-6-squeeze
- The tutorial this blog post is based on mostly: http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/
- HowTo Install Redmine on Debian Squeeze with Postgresql Ruby-on-Rails and Apache2-Passenger: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_Squeeze_with_Postgresql_Ruby-on-Rails_and_Apache2-Passenger
- On Ubuntuusers Wiki (German): http://wiki.ubuntuusers.de/Baustelle/Redmine
- Good guide on gitosis: http://progit.org/book/ch4-7.html
- Redmine Styles and Themes
- A modern alternative: Gitlab – Self Hosted Git Management based on Ruby on Rails & Gitolite