zoukankan      html  css  js  c++  java
  • centos install redmine (项目管理工具)

    1. 安装环境:Centos、mysql、Ruby、Apache、Redmine
      yum update
      yum -y groupinstall "Development Tools"
      yum -y install zip unzip libyaml-devel zlib zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel gcc ruby-devel gcc-c++ make postgresql-devel ImageMagick-devel sqlite-devel perl-LDAP mod_perl perl-Digest-SHA ImageMagick-devel ntp apr-devel apr-util-devel mlocate manlibxml2-devel libxslt-devel libffi-devel readline-devel
      yum -y install httpd mysql mysql-server
      service mysqld restart
      mysql_secure_installation
      关闭 selinux
      setenforce 0
      sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
      sed -i "s/SELINUXTYPE=targeted/#SELINUXTYPE=targeted/g" /etc/selinux/config
      开启防火墙的 80、443 端口,并重启防火墙
      vi /etc/sysconfig/iptables
      安装php、phpMyAdmin
      yum -y install php php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-soap
      rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm
      yum -y install phpmyadmin
      vi /etc/httpd/conf.d/phpMyAdmin.conf
      将 "Allow from 127.0.0.1" 替换为 "Allow from All"
      vi /etc/phpMyAdmin/config.inc.php 
      将 $cfg['Servers'][$i]['auth_type'] = 'cookie' 替换为 $cfg['Servers'][$i]['auth_type'] = 'http';
      安装 RVM
      curl -L https://get.rvm.io | bash
      source /etc/profile.d/rvm.sh
      安装Ruby
      rvm list known
      rvm install 1.9.3
      rvm use 1.9.3 --default
      ruby -v
      yum -y install rubygems
      gem sources --remove https://rubygems.org/
      gem sources -a https://ruby.taobao.org/
      gem sources -l
      gem install rails
      gem install passenger
      passenger-install-apache2-module
      vi /etc/httpd/conf.d/passenger.conf
      LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.10/buildout/apache2/mod_passenger.so
      <IfModule mod_passenger.c>
      PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.10
      PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby
      </IfModule>
      passenger.conf Code
      重启 apache 
      设置Mysql
      mysql -user=root -password=root_password_mysql
      create database redmine_db character set utf8;
      create user 'redmine_admin'@'localhost' identified by 'your_new_password';
      grant all privileges on redmine_db.* to 'redmine_admin'@'localhost';
      flush privileges;
      quit;
      给网站目录添加Redmine
      mkdir -p /home/redmine.com/public_html
      mkdir -p /home/redmine.com/logs
      cd /home/redmine.com/public_html
      wget http://www.redmine.org/releases/redmine-2.5.0.tar.gz
      tar xvfz redmine-2.5.0.tar.gz
      mv redmine-2.5.0 redmine
      rm -rf redmine-2.5.0.tar.gz
      cp -r redmine/. /home/redmine.com/public_html
      rm -rf redmine
      添加Redmine虚拟主机文件
      vi /etc/httpd/conf.d/vhost.conf
      <VirtualHost *:80> 
           ServerAdmin mycheryhr@gmail.com
           ServerName redmine.com 
           ServerAlias www.redmine.com *.redmine.com 
           DocumentRoot /home/redmine.com/public_html/public/ 
           ErrorLog /home/redmine.com/logs/error.log 
           CustomLog /home/redmine.com/logs/access.log combined 
               <Directory "/home/redmine.com/public_html/public/">
                      Options Indexes ExecCGI FollowSymLinks
                      Order allow,deny
                      Allow from all
                      AllowOverride all
              </Directory>
      </VirtualHost> 
      redmine.conf Code

      修改Redmine数据库连接信息
      cd /home/redmine.com/public_html/config
      cp database.yml.example database.yml
      vi database.yml
      初始化 Rails
      cd /home/redmine.com/public_html
      gem install bundler
      bundle install
      rake generate_secret_token
      建立 Database schema objects,加入預設資料
      RAILS_ENV=production rake db:migrate
      RAILS_ENV=production rake redmine:load_default_data
      chmod -R 777 /home/redmine.com/public_html
      chown -R apache:apache /home/redmine.com/public_html
      激活Activate FCGI
      cd /home/redmine.com/public_html/public
      mkdir plugin_assets
      cp dispatch.fcgi.example dispatch.fcgi
      cp htaccess.fcgi.example .htaccess
      设置Apache and FastCGI
      cd /home/redmine.com/public_html/
      rpm --import https://fedoraproject.org/static/0608B895.txt
      wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
      rpm -ivh epel-release-6-8.noarch.rpm
      yum -y install mod_fcgid
      rm -rf epel-release-6-8.noarch.rpm
      创建文件目录
      mkdir -p /opt/redmine/files
      chown -R apache:apache /opt/redmine
      cd /home/redmine.com/public_html/config
      cp configuration.yml.example configuration.yml
      vi configuration.yml

      添加如下配置:
      attachments_storage_path : /opt/redmine/files

    2. 建议参考的安装文档

      http://www.redmine.org/projects/redmine/wiki/Install_Redmine_25x_on_Centos_65_complete

      http://blog.csdn.net/win_lin/article/details/8514333

      http://blog.tonycube.com/2013/11/redmine-centos-apache-ruby-on-rails.html

    3. 遇到过的问题,建议参考下面的几个解决方法

      http://stackoverflow.com/questions/22571206/netbeans-and-rails-error-bin-ruby-no-such-file-or-directory-script-rails-

    4. 迁移方法

      https://ruby-china.org/topics/8340

    5. 技巧

      A、默认需要加上端口3000才可以访问,解决方法在vhost.conf中添加:

        ProxyPass / http://localhost:3000/

        ProxyPassReverse / http://localhost:3000/

      B、发送邮件

      http://blog.csdn.net/maktub_haixue/article/details/39394111

      C、开机启动及脚本

      http://www.vipzhicheng.com/blog/2014/04/09/install-redmine-on-centos/

    6. #!/bin/bash
      # Modify it to your configuration
      DIR=/var/www/html/redmine/
       
      # Start Redmine in daemon mode.
      start(){
        cd $DIR
        ruby script/rails server -d -e production
      }
      # Stop Redmine daemon
      stop(){
        RUBYPID=`ps aux | grep "ruby script/rails" | grep -v grep | awk '{print $2}'`
        if [ "x$RUBYPID" != "x" ]; then
          kill -2 $RUBYPID
        fi
      }
      # Check if Redmine is running
      status(){
        RUBYPID=`ps aux | grep "ruby script/rails" | 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)
          start
          status
          ;;
        stop)
          stop
          sleep 2
          status
          ;;
        status)
          status
          ;;
        restart|force-reload)
          stop
          start
          ;;
        *)
          echo "Usage: $0 {start|stop|restart|force-reload|status}"
          exit 1
      esac
      View Code
  • 相关阅读:
    Linux 如何通过命令查看一个文件的某几行(中间几行或最后几行)
    linux 定义变量 ,添加变量值
    Linux下的vi编辑命令中查找·替换详解
    linux vi 块操作、多窗口
    linux 磁盘 分区、格式化、挂载
    linux 重名名、删除文件操作
    linux vi
    linux 文件查阅 cat、more、less、tail
    linux ls touch、umask、 chattr
    linux 目录配置
  • 原文地址:https://www.cnblogs.com/Mrhuangrui/p/4571703.html
Copyright © 2011-2022 走看看