# <user>
useradd redmine
passwd redmine
chown -R redmine:redmine /home/redmine/app/redmine
chmod -R 755 /home/redmine/app/redmine
tar zxvf redmine-3.0.1.tar.gz
mkdir /home/redmine/app/
mv redmine-3.0.1 /home/redmine/app/redmine
# <database>
mysql -u root -p
create database redmine character set 'utf8';
create user 'redmine'@'localhost' identified by 'red1234';
grant all privileges on redmine.* to 'redmine'@'localhost';
cd /home/redmine/app/redmine/config
cp database.yml.example database.yml
vim database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: red1234
# <yum>
# need to download from http://rpm.pbone.net/ and upload to current dir
yum install ghostscript-devel-*el7.x86_64.rpm
yum install jasper-devel-*el7.x86_64.rpm
yum install ruby-devel-*.rpm
yum install libxml2-devel-*el7.x86_64.rpm
yum install libxslt-devel-*el7.x86_64.rpm
# <bundle>
# log in with user redmine
cd /home/redmine/app/redmine
vim Gemfile
source 'https://ruby.taobao.org/'
gem install bundler
bundle config build.nokogiri --use-system-libraries
bundle install --without development test rmagick
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
# <permission>
# log in with root
cd /home/redmine/app/redmine
mkdir -p tmp tmp/pdf public/plugin_assets
chown -R redmine:redmine files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
vim /etc/sysconfig/iptables # add 3000 port
systemctl restart iptables
# <run>
# login with redmine
cd ~/app/redmine/
ruby bin/rails server webrick -e production -d -b=0.0.0.0
# http://<ip>:3000/, admin/admin
# <autostart>
touch /etc/init.d/redmine
vim redmine
#!/bin/sh
REDMINE_HOME=/home/redmine/app/redmine
LOG=$REDMINE_HOME/sysv-redmine.log
case "$1" in
start)
echo "redmine start begin"
date +"%T %a %d: redmine start begin" >> $LOG 2>&1
su - redmine -c "cd $REDMINE_HOME &&
ruby bin/rails server webrick -e production -d -b 0.0.0.0" >> $LOG 2>&1
date +"%T %a %d: redmine start end" >> $LOG 2>&1
echo "redmine start end"
touch /var/lock/subsys/redmine
;;
stop)
echo "redmine stop begin"
date +"%T %a %d: redmine stop begin" >> $LOG 2>&1
PID=`ps -ef | grep 'webrick' | grep -v grep | awk '{print $2}'`
if [ ! -z "$PID" ]; then
kill -15 $PID
fi
date +"%T %a %d: redmine start end" >> $LOG 2>&1
echo "redmine stop end"
rm -f /var/lock/subsys/redmine
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: service redmine {start|stop|restart}"
exit 1
esac
exit 0
chomod -R 777 redmine
service redmine start
useradd redmine
passwd redmine
chown -R redmine:redmine /home/redmine/app/redmine
chmod -R 755 /home/redmine/app/redmine
tar zxvf redmine-3.0.1.tar.gz
mkdir /home/redmine/app/
mv redmine-3.0.1 /home/redmine/app/redmine
# <database>
mysql -u root -p
create database redmine character set 'utf8';
create user 'redmine'@'localhost' identified by 'red1234';
grant all privileges on redmine.* to 'redmine'@'localhost';
cd /home/redmine/app/redmine/config
cp database.yml.example database.yml
vim database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: red1234
# <yum>
# need to download from http://rpm.pbone.net/ and upload to current dir
yum install ghostscript-devel-*el7.x86_64.rpm
yum install jasper-devel-*el7.x86_64.rpm
yum install ruby-devel-*.rpm
yum install libxml2-devel-*el7.x86_64.rpm
yum install libxslt-devel-*el7.x86_64.rpm
# <bundle>
# log in with user redmine
cd /home/redmine/app/redmine
vim Gemfile
source 'https://ruby.taobao.org/'
gem install bundler
bundle config build.nokogiri --use-system-libraries
bundle install --without development test rmagick
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data
# <permission>
# log in with root
cd /home/redmine/app/redmine
mkdir -p tmp tmp/pdf public/plugin_assets
chown -R redmine:redmine files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
vim /etc/sysconfig/iptables # add 3000 port
systemctl restart iptables
# <run>
# login with redmine
cd ~/app/redmine/
ruby bin/rails server webrick -e production -d -b=0.0.0.0
# http://<ip>:3000/, admin/admin
# <autostart>
touch /etc/init.d/redmine
vim redmine
#!/bin/sh
REDMINE_HOME=/home/redmine/app/redmine
LOG=$REDMINE_HOME/sysv-redmine.log
case "$1" in
start)
echo "redmine start begin"
date +"%T %a %d: redmine start begin" >> $LOG 2>&1
su - redmine -c "cd $REDMINE_HOME &&
ruby bin/rails server webrick -e production -d -b 0.0.0.0" >> $LOG 2>&1
date +"%T %a %d: redmine start end" >> $LOG 2>&1
echo "redmine start end"
touch /var/lock/subsys/redmine
;;
stop)
echo "redmine stop begin"
date +"%T %a %d: redmine stop begin" >> $LOG 2>&1
PID=`ps -ef | grep 'webrick' | grep -v grep | awk '{print $2}'`
if [ ! -z "$PID" ]; then
kill -15 $PID
fi
date +"%T %a %d: redmine start end" >> $LOG 2>&1
echo "redmine stop end"
rm -f /var/lock/subsys/redmine
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: service redmine {start|stop|restart}"
exit 1
esac
exit 0
chomod -R 777 redmine
service redmine start