六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 915|回复: 0

CentOS下apache svn redmine集成环境安装

[复制链接]
 楼主| 发表于 2016-3-10 18:24:11 | 显示全部楼层 |阅读模式
CentOS下apache svn redmine集成环境安装
这是一套免费的项目管理软件,推荐大家使用。废话不说进主题。

第一步,安装CentOS,如有疑问可以在本BLOG内搜索CentOS的图文安装教程。

第二步安装Apache

1.yum -y install httpd

2.编辑apache的配置文件
    vi /etc/httpd/conf/httpd.conf

    Options Indexes FollowSymLinks
  ↓
    Options Includes ExecCGI FollowSymLinks ← 允许CGI,SSI

    AllowOverride None
  ↓
    AllowOverride All ← 允许.htaccess

    #AddHandler cgi-script .cgi
    ↓
    AddHandler cgi-script .cgi .pl ← 支持Cgi和pl

3.配置好后重启apache
   /etc/rc.d/init.d/httpd start 

4.将apache服务添加到开机启动项
    chkconfig httpd on

第三步安装SVN

1.yum -y install subversion mod_dav_svn

2.编辑svn配置文件
   vi /etc/httpd/conf.d/subversion.conf 


  把下面的内容加在配置文件的末尾
<Location /repos>
   DAV svn
   SVNParentPath /var/www/svn   //SVN仓库目录
   SVNAutoversioning on
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
   Allow from 192.168.1.0/24
   Allow from 192.168.2.0/24


   # Limit write permission to list of valid users.
#   <LimitExcept GET PROPFIND OPTIONS REPORT>  //需要认证时
      # Require SSL connection for password protection.
      # SSLRequireSSL

      AuthType Basic
      AuthName "Subversion repository"  //必须认证用户名和密码

      #AuthName "Authorization Realm"
      AuthUserFile /var/www/svn
      Require valid-user
#   </LimitExcept>
</Location>

3.建立SVS仓库目录   
   mkdir /var/www/svn 

4.更改目录权限
  chown apache:apache /var/www/svn 

5.重新读取配置信息
  /etc/rc.d/init.d/httpd reload

6.建立SVN仓库
  svnadmin create /var/www/svn/eye

7.更改目录所有者
   chown -R apache:apache /var/www/svn/eye/

8.建立用户信息
  htpasswd -cm /var/www/svn/auth-conf username1
  -cm  参数说明 -c 是建立  -m 是修改 第一建立验证文件的时候用这个,以后添加用户的时候只加 -m就可以了,不然原来建立的用户会被清空的

第四步安装MYSQL

1.yum -y install mysql-server

2.编辑mysql的配置文件
   vi /etc/my.cnf

    old_passwords=1
    default-character-set = utf8 ← 设置编码为UTF-8

     设置客户端默认文字编码为UTF-8
     [mysql]
     default-character-set = utf8

3.启动mysql
    /etc/rc.d/init.d/mysqld start

4.将MYSQL加入启动项
    chkconfig mysqld on

5.设置mysql的用户信息
    mysql -u root

    select user,host,password from mysql.user;
    set password for root@localhost=password('root密码'); ← 设置密码

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'eye' WITH GRANT OPTION;

第四步安装各种插件
     yum  install -y httpd-devel openssl-devel zlib-devel gcc gcc-c++ curl-devel expat-devel gettext-devel mysql-devel


第五步安装Ruby

    wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.7-p249.tar.gz
    tar -zxvf ruby-1.8.7-p249.tar.gz
    cd ruby-1.8.7-p249
    ./configure --enable-shared --enable-pthread --with-openssl-dir=/usr/lib/openssl
    make
    make install

    cd ext/zlib
    ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
    cd ../../
    make
    make install


第六步安装RubyGems
    wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
    tar -zxvf rubygems-1.3.7.tgz
    cd rubygems-1.3.7
    ruby setup.rb

第七步安装rails
    gem install rails -v=2.3.5

第八步设置mysql
    gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

第九步安装passenger
    gem install passenger
    passenger-install-apache2-module


第十步安装redmine

    1.checkout redmine源码
        svn checkout http://redmine.rubyforge.org/svn/trunk redmine

    2.建立数据库
        create database redmine character set utf8;
        create user 'redmine'@'localhost' identified by 'my_password';
        grant all privileges on redmine.* to 'redmine'@'localhost';

        grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';


    3.更改datebase配置文件
        cp config/database.yml.example config/database.yml
        vi config/database.yml

    4.初始化renmine信息   
        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

    5.启动redmine
        ruby script/server webrick -e production

用这个URL测试下,http://localhost:3000/  。redmine的画面出来啦,恭喜你,基本可以使用啦!!!!



第十一步集成Redmine和Apache
    1.更改Apache的配置文件:
    vim /etc/httpd/conf/httpd.conf
    在文件里加入下面的内容 注意各个路径
    LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.13/ext/apache2/mod_passenger.so
    PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.13
    PassengerRuby /usr/local/bin/ruby

    RailsBaseURI /redmine
    <Directory /var/www/html/redmine>
        Options -MultiViews
    </Directory>

    2.更改dispatch.cgi.example
        cp dispatch.cgi.example dispatch.cgi

    3.更改权限
        chmod 755 public
        chmod 755 public/dispatch.cgi
        chmod -R 775 log
        chmod -R 775 tmp


    cd /var/www/html
    ln -s /var/www/redmine/public redmine
    service httpd restart



第十二步集成Redmine和SVN

    1.把下面的配置信息添加到SVN中:
        bugtraq:url = http://xxxxxx/redmine/issues/%BUGID%
        bugtraq:warnifnoissue = true
        bugtraq:message = refs #%BUGID%

        可以参考下面的URL:
[url]http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugtracker.html[/url]


第十三步SVN提交即时反应到redmine系统内

    1.更改post-commit文件
        cp post-commit.templete post-commit
        vi post-commit
        ruby /usr/local/redmine-0.9.4/script/runner -e production "Repository.fetch_changesets" 注意runner路径

    2.更改post-commit 文件权限为755

到此本教程结束,恭喜您的apache svn redmine系统已经安装完毕,尽情的使用吧!

http://www.jszl.org/post-46.htmlCentOS下apache svn redmine集成环境安装
该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表