Search This Blog

Wednesday, March 23, 2016

Redmine 3.2.1 bare server running on Debian Jessie

Need Upgrade Redmine to the latest stable 3.2.1.

Download the latest stable package:
cd /var/www
wget http://www.redmine.org/releases/redmine-3.2.1.tar.gz
tar xzvf redmine-3.2.1.tar.gz
chown -R root:root redmine-3.2.1/

Copy the configure file and SQLite database file:
cp /var/www/redmine-3.2.0/config/configuration.yml /var/www/redmine-3.2.1/config/configuration.yml
cp /var/www/redmine-3.2.0/config/database.yml /var/www/redmine-3.2.1/config/database.yml
cp /var/www/redmine-3.2.0/db/redmine.sqlite3 /var/www/redmine-3.2.1/db/redmine.sqlite3

Perform upgrade:
cd /var/www/redmine-3.2.1
bundle install --without development test rmagick
bundle exec rake generate_secret_token
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production

Testing Run:
ruby /var/www/redmine-3.2.1/bin/rails server webrick -e production -b 192.168.1.33 -p 80

And to start Redmine automatic on boot:

My latest service script /etc/init.d/redmine:
#!/bin/sh
### BEGIN INIT INFO
# Provides: redmine
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redmine webrick
# Description: redmine webrick server autostart-script
### END INIT INFO

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DESC="redmine webrick daemon"
NAME=redmine
PIDFILE=/var/run/redmine.pid
SCRIPTNAME=/etc/init.d/"$NAME"

. /lib/lsb/init-functions

# Modify it to your configuration
DIR=/var/www/redmine-3.2.1/

# Start Redmine in daemon mode.
do_start(){
cd $DIR
ruby /var/www/redmine-3.2.1/bin/rails server webrick -e production -b 192.168.1.33 -p 80 > /var/log/redmine.log
}

# Stop Redmine daemon
do_stop(){
RUBYPID=`ps aux | grep "ruby /var/www/redmine-3.2.1/bin/rails server webrick" | grep -v grep | awk '{print $2}'`
if [ "x$RUBYPID" != "x" ]; then
kill -2 $RUBYPID
fi
}

# Check if Redmine is running
do_status(){
RUBYPID=`ps aux | grep "ruby /var/www/redmine-3.2.1/bin/rails server webrick" | grep -v grep | awk '{print $2}'`
if [ "x$RUBYPID" = "x" ]; then
echo "* Redmine is not running"
else
echo "* Redmine is running"
fi
}


case "$1" in
start)
do_start
;;

stop)
do_stop
;;

status)
do_status
;;

restart|force-reload)
do_stop
do_start
;;

*)
echo "Usage: $0 {start|stop|restart|force-reload|status}"
exit 1

esac

Don't forgot active the service in Debian Jessie:
update-rc.d redmine defaults
systemctl daemon-reload
service redmine start
service redmine status


Please notice my local Redmine server IP is: [192.168.1.33].
You will replace it with your own IP address.

No comments:

Post a Comment