Sistemas‎ > ‎Linux‎ > ‎

Redmine no Centos 6.5 64bits

Configuração do Redmine no Centos 6.5 64bits
Criado por Silvio Garbes

 # yum update
 # vi /etc/selinux/config
 SELINUX=disabled
 # yum install httpd mysql mysql-server mysql-devel ruby ruby-devel rubygems gcc subversion wget ImageMagick ImageMagick-devel gcc-c++ curl-devel httpd-devel apr-devel  apr-util-devel
 # gem install rake
 # gem update --system
 # gem install mysql
 # gem install rails
 # cd /root
 # tar -vzxf redmine-2.4.2.tar.gz
 # mv redmine-2.4.2 /var/redmine
 # cd /var/redmine

 Crie o banco de dados MySQL
  CREATE DATABASE redmine CHARACTER SET utf8;
  CREATE USER 'redmine'@'%' IDENTIFIED BY '***';
  GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'%';
 For versions of MySQL prior to 5.0.2 - skip the 'create user' step and instead:
  GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'my_password';

 # cd config
 # cp database.yml.example database.yml
 # ruby -v
 # vi database.yml

 production:
  adapter: mysql
  database: redmine
  host: mysql01.silviogarbes.com.br
  username: redmine
  password: "***"
  encoding: utf8

 # gem install bundler
 # gem install rmagick
 # bundle install --without development test
 # rake generate_secret_token
 # RAILS_ENV=production rake db:migrate
 # RAILS_ENV=production REDMINE_LANG=pt-BR rake redmine:load_default_data
 #   chown -R apache:apache /var/redmine
 # chmod -R 755 files log tmp public/plugin_assets
 # vi /etc/sysconfig/iptables
 adicione:
 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT

 # /etc/init.d/iptables restart
 # ruby script/rails server webrick -e production
 # http://192.168.1.1:3000/

 Teste a aplicação
 login: admin
 password: admin

 Pare o serviço executanto Ctrl+c

 # cd config
 # cp configuration.yml.example configuration.yml
 # vi configuration.yml

 default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: smtp.silviogarbes.com.br
      port: 25
      domain: silviogarbes.com.br
      authentication: nil
      user_name: "redmine@silviogarbes.com.br"
      password: "redmine"

 // ---------------------//
 // Script inicialização //
 // ---------------------//
 
 # vi /etc/init.d/redmine
 # chmod 755 /etc/init.d/redmine
 # chkconfig --add redmine
 # chkconfig --level 235 redmine on
 # chkconfig --list | grep redmine 


 // -------- SCRIPT -------- //
 
 #!/bin/sh
 # chkconfig: 345 99 10
 # description: Redmine
 #
 # Descricao: Inicializador do Redmine Task Tracking System.
 #
 # Criado por Rogerio J. Gentil em 20/12/2010.
 # Modificado por Silvio Garbes em 31/01/2014
  
 # Path do servidor script do Redmine.
 RED_PATH=/var/redmine
 
 # Daemon.
 NAME=redmine
 ARGS="-e production -d"
 PID=$RED_PATH/tmp/pids/server.pid
 PID_FILE=/var/run/$NAME.pid  
  
 start(){ 
        ec ho -n "Iniciando ${NAME}: "
        
        cd $RED_PATH
        ruby script/rails server webrick $ARGS
        
        sleep 2
        
        touch $PID_FILE
        cat $PID > $PID_FILE
        
        echo
 }
 
 # Check if Redmine is running
 status(){
        RUBYPID=`ps aux | grep "ruby script/rails server webrick ${ARGS}" | grep -v grep | awk '{print $2}'`
        if [ "x$RUBYPID" = "x" ]; then
         echo "* Redmine is not running"
        else
         echo "* Redmine is running"
        fi
 }
 
 stop(){
        echo -n "Parando ${NAME}: "
        
        PROCESS=`cat $PID_FILE`
        
        kill -9 $PROCESS && /bin/rm -f $PID_FILE
        
        echo
 }
 
 case "$1" in
        start)
                start
                ;;
        status)
                status
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
        *)
                echo "Use: $SCRIPTNAME {start|status|stop|restart}"
                exit 3
                ;;
 esac
 
 # Fim do script.
 
 
 // ----------- FIM --------// 



// ------------ //
// Gerar backup //
// ------------ //
  # Database
  /usr/bin/mysqldump -u <username> -p<password> <redmine_database> | gzip > /path/to/backup/db/redmine_`date +%y_%m_%d`.gz
  
  # Attachments
  rsync -a /path/to/redmine/files /path/to/backup/files





Fonte:
Comments