>>>>概述<<<<

这里不解释什么是redmine及用来做什么,如果不知道用来做什么,估计也不会把它安装到CentOS5.4上。哈哈……

以下为详细的步骤,筒子们可以在安装好CentOS5.4后,直接复制其命令就能安装顺利。

如果你的机器的环境与我的不同,或者本身已经在CentOS5.4上安装过其它的应用(如:mysql-server等)可以在以下安装步骤中,省略安装此包即可。

详细的步骤如下:

<<1>>需要上网环境

将安装好的CentOS5.4配置上网,并测试上网环境:

[root@localhost ~]# ping -c 3 baidu.com

PING baidu.com (123.125.114.144) 56(84) bytes of data.
64 bytes from 123.125.114.144: icmp_seq=1 ttl=48 time=37.2 ms
64 bytes from 123.125.114.144: icmp_seq=2 ttl=49 time=38.5 ms
64 bytes from 123.125.114.144: icmp_seq=3 ttl=49 time=36.6 ms
--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2016ms
rtt min/avg/max/mdev = 36.666/37.488/38.555/0.821 ms

如果配置网络环境,请参见:http://blog.csdn.net/leekwen/article/details/8516795

如需要修改自定义的快速源的,请自行baidu,不再这里详述。

<<2>>安装基础包

[root@localhost ~]# yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-server mysql mysql-devel

以上的操作 " Complete! " 之后,接着操作如下的命令:

[root@localhost ~]# service mysqld restart
Stopping mysqld:                                              [  OK  ]
Initializing MySQL database:  Installing MySQL system tables...  OK
Filling help tables...                                           OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h bye password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com    [  OK  ]
Starting mysqld:                                                     [  OK  ]

[root@localhost ~]# mysqladmin -uroot password 'leekwen'

[root@localhost ~]# mysql -uroot -pleekwen
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.95 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.01 sec)

mysql> \q;
Bye

<<3>>安装ruby及rubygems等其它需求包

[root@localhost ~]# mkdir redmine-pkg
[root@localhost ~]# cd redmine-pkg/

[root@localhost redmine-pkg]# wget -c ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p371.tar.gz
--2013-01-17 21:20:16--  ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p371.tar.gz
           => `ruby-1.8.7-p371.tar.gz'
Resolving ftp.ruby-lang.org... 221.186.184.68
Connecting to ftp.ruby-lang.org|221.186.184.68|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/ruby/1.8 ... done.
==> SIZE ruby-1.8.7-p371.tar.gz ... 4902800
==> PASV ... done.    ==> RETR ruby-1.8.7-p371.tar.gz ... done.
Length: 4902800 (4.7M)

100%[====================================================================>] 4,902,800    731K/s   in 16s

2013-01-17 21:20:38 (291 KB/s) - `ruby-1.8.7-p371.tar.gz' saved [4902800]

[root@localhost redmine-pkg]# tar zxvf ruby-1.8.7-p371.tar.gz

[root@localhost redmine-pkg]# cd ruby-1.8.7-p371
[root@localhost ruby-1.8.7-p371]# ./configure --prefix=/usr/

[root@localhostruby-1.8.7-p371]# make

compiling tk/tkutil
compiling win32ole
compiling zlib
make[1]: Entering directory `/root/redmine-pkg/ruby-1.8.7-p371/ext/zlib'
gcc -I. -I../.. -I../../. -I../.././ext/zlib -DHAVE_ZLIB_H  -DOS_CODE=OS_UNIX  -D_FILE_OFFSET_BITS=64  -fPIC -g -O2   -c zlib.c
gcc -shared -o ../../.ext/i686-linux/zlib.so zlib.o -L. -L../.. -L.  -rdynamic -Wl,-export-dynamic    -lz  -lrt -ldl -lcrypt -lm   -lc
make[1]: Leaving directory `/root/redmine-pkg/ruby-1.8.7-p371/ext/zlib'
making ruby
make[1]: Entering directory `/root/redmine-pkg/ruby-1.8.7-p371'
gcc -g -O2    -DRUBY_EXPORT -D_GNU_SOURCE=1  -L.  -rdynamic -Wl,-export-dynamic   main.o  -lruby-static -lrt -ldl -lcrypt -lm   -o ruby
make[1]: Leaving directory `/root/redmine-pkg/ruby-1.8.7-p371'
[root@localhost ruby-1.8.7-p371]# make install
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb  ./instruby.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
installing binary commands
installing command scripts
installing library scripts
installing headers
installing manpages
installing extension objects
installing extension scripts

[root@localhost ruby-1.8.7-p371]#ruby -v
ruby 1.8.7 (2012-10-12 patchlevel 371) [i686-linux]
[root@localhost ruby-1.8.7-p371]# cd ..

[root@localhost redmine-pkg]# wget -c http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
--2013-01-17 21:28:00--  http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
Resolving production.cf.rubygems.org... 54.240.168.218, 54.240.168.202, 54.240.168.14, ...
Connecting to production.cf.rubygems.org|54.240.168.218|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 380101 (371K) [application/x-tar]
Saving to: `rubygems-1.8.24.tgz'
50% [=========================================================> ] 380,101      771K/s   in 0.5s
2013-01-17 21:28:01 (771 KB/s) - `rubygems-1.8.24.tgz' saved [380101/380101]

[root@localhost redmine-pkg]# tar zxf rubygems-1.8.24.tgz
[root@localhost redmine-pkg]# cd rubygems-1.8.24
[root@localhost rubygems-1.8.24]# ruby setup.rb
RubyGems 1.8.24 installed
== 1.8.24 / 2012-04-27
* 1 bug fix:
  * Install the .pem files properly. Fixes #320
  * Remove OpenSSL dependency from the http code path
----------------------------------------------------------
RubyGems installed the following executables:
        /usr/bin/gem
[root@localhost rubygems-1.8.24]# gem --version
1.8.24

[root@localhost rubygems-1.8.24]# cd ..
[root@localhost redmine-pkg]# wget -c http://rubyforge.org/frs/download.php/76681/redmine-2.1.6.tar.gz

Connecting to files.rubyforge.vm.bytemark.co.uk|80.68.94.54|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3717789 (3.5M) [application/x-gzip]
Saving to: `redmine-2.1.6.tar.gz'
100%[==================================================================>] 3,717,789    904K/s   in 4.0s
2013-01-17 21:42:44 (904 KB/s) - `redmine-2.1.6.tar.gz' saved [3717789/3717789]

[root@localhost redmine-pkg]# tar zxf redmine-2.1.6.tar.gz -C /usr/local/
[root@localhost redmine-pkg]# cd /usr/local/redmine-2.1.6/
[root@localhost redmine-2.1.6]# gem install bundler
Fetching: bundler-1.2.3.gem (100%)
Successfully installed bundler-1.2.3
1 gem installed
Installing ri documentation for bundler-1.2.3...
Installing RDoc documentation for bundler-1.2.3...

[root@localhost redmine-2.1.6]# bundle install --without development test postgresql sqlite rmagick
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Using rake (10.0.3)
Using i18n (0.6.1)
Using multi_json (1.5.0)
Using activesupport (3.2.11)
Using builder (3.0.0)
Using activemodel (3.2.11)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.4)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.2.2)
Using actionpack (3.2.11)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.11)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.11)
Using activeresource (3.2.11)
Using bundler (1.2.3)
Using coderay (1.0.8)
Using fastercsv (1.5.5)
Using rack-ssl (1.3.2)
Using json (1.7.6)
Using rdoc (3.12)
Using thor (0.16.0)
Using railties (3.2.11)
Using jquery-rails (2.0.3)
Installing mysql (2.8.1) with native extensions
Installing net-ldap (0.3.1)
Installing ruby-openid (2.1.8)
Installing rack-openid (1.3.1)
Installing rails (3.2.11)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

[root@localhost redmine-2.1.6]# gem install tlsmail
Fetching: tlsmail-0.0.1.gem (100%)
Successfully installed tlsmail-0.0.1
1 gem installed
Installing ri documentation for tlsmail-0.0.1...
Installing RDoc documentation for tlsmail-0.0.1...

<<4>>建立redmine连接的数据库(注意,数据库字符码)

[root@localhost redmine-2.1.6]# mysql -uroot -pleekwen
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

mysql> create database redmine character set utf8;
Query OK, 1 row affected (0.02 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| redmine            |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'leekwen';
Query OK, 0 rows affected (0.03 sec)

mysql> \q;
Bye

<<5>>配置redmine服务

[root@localhost redmine-2.1.6]# cp config/database.yml.example config/database.yml
[root@localhost redmine-2.1.6]# vi config/database.yml
[root@localhost redmine-2.1.6]# cat config/database.yml
# Default setup is given for MySQL with ruby1.8. If you're running Redmine
# with MySQL and ruby1.9, replace the adapter name with `mysql2`.
# Examples for PostgreSQL and SQLite3 can be found at the end.

#只保留如下的几行信息即可:
production:
  adapter: mysql
  database: redmine
  host: localhost
  username: root
  password: leekwen
  encoding: utf8
[root@localhost redmine-2.1.6]# rake generate_secret_token
[root@localhost redmine-2.1.6]# RAILS_ENV=production rake db:migrate
==  Setup: migrating ================================================

=========-------------------中间部分省略显示-------------------========
==  AddBoardsParentId: migrated (0.0188s) ===========================

[root@localhost redmine-2.1.6]# RAILS_ENV=production rake redmine:load_default_data
Select language: ar, bg, bs, ca, cs, da, de, el, en, en-GB, es, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]zh
====================================
Default configuration data loaded.

[root@localhost redmine-2.1.6]# finger redmine
finger: redmine: no such user.
[root@localhost redmine-2.1.6]# groupadd redmine
[root@localhost redmine-2.1.6]# adduser redmine -g redmine
[root@localhost redmine-2.1.6]# chown -R redmine:redmine files/ log/ tmp/ public/
[root@localhost redmine-2.1.6]# chmod -R 755 files/ log/ tmp/ public/
[root@localhost redmine-2.1.6]# ruby script/rails server webrick -e production &
[1] 23791
=> Booting WEBrick
=> Rails 3.2.11 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-01-18 00:39:10] INFO  WEBrick 1.3.1
[2013-01-18 00:39:10] INFO  ruby 1.8.7 (2012-10-12) [i686-linux]
[2013-01-18 00:39:10] INFO  WEBrick::HTTPServer#start: pid=23791 port=3000
[root@localhost redmine-2.1.6]# netstat -tln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:3000                0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:924                 0.0.0.0:*                   LISTEN
tcp        0      0 :::22                       :::*                        LISTEN

[root@localhost redmine-2.1.6]# chkconfig iptables --list
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@localhost redmine-2.1.6]# chkconfig iptables off
[root@localhost redmine-2.1.6]# chkconfig iptables --list
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off

[root@localhost redmine-2.1.6]# ifconfig eth0 |grep addr:
          inet addr:192.168.160.11 Bcast:192.168.160.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed1:a6ed/64 Scope:Link

[root@localhost redmine-2.1.6]# telnet 192.168.160.11 3000
Trying 192.168.160.11...
Connected to 192.168.160.11 (192.168.160.11).
Escape character is '^]'.
^]
[2013-01-18 00:50:00] ERROR bad Request-Line `^]'.
HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 288
Date: Fri, 18 Jan 2013 08:50:00 GMT
Server: WEBrick/1.3.1 (Ruby/1.8.7/2012-10-12)
Connection: close
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
  <HEAD><TITLE>Bad Request</TITLE></HEAD>
  <BODY>
    <H1>Bad Request</H1>
    bad Request-Line `^]'.
    <HR>
    <ADDRESS>
     WEBrick/1.3.1 (Ruby/1.8.7/2012-10-12) at
     bye.localdomain:3000
    </ADDRESS>
  </BODY>
</HTML>
Connection closed by foreign host.
[root@localhost redmine-2.1.6]# service iptables stop
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]

此时简单的配置已经完成,你就可以对redmine进行页面的访问了。访问方式为:http://IP:3000

如果无法访问,请检查自己的服务器是否开了防火墙,我这里为了测试方便直接地将防火墙给禁用了。

CentOS5.4安装redmine详细步骤的更多相关文章

  1. Git学习系列之Windows上安装Git详细步骤(图文详解)

    前言 最初,Git是用于Linux下的内核代码管理.因为其非常好用,目前,已经被成功移植到Mac和Windows操作系统下. 鉴于大部分使用者使用的是Windows操作系统,故,这里详细讲解Windo ...

  2. 2021最新WordPress安装教程(三):安装WordPress详细步骤

    前面已经通过< 2021最新WordPress安装教程(一):Centos7安装Apache>和< 2021最新WordPress安装教程(二):配置PHP和MySQL>两篇文 ...

  3. Centos5.8 安装 Redmine

    安装Ruby 到 /opt/ruby-2.0.0 -p481.tar.gz cd ruby--p481 ./configure --prefix=/opt/ruby- sudo make sudo m ...

  4. 在linux上安装Scala详细步骤

    scala在linux安装很简单,就是下载,解压,配置环境变量,source一下成功. 提君博客原创 >>提君博客原创 http://www.cnblogs.com/tijun/ < ...

  5. Ubuntu下安装Nginx详细步骤

    Nginx安装之前需要三个支持: 模块依赖性 ①gzip 模块需要 zlib 库 ②rewrite 模块需要 pcre 库 ③ssl 功能需要 openssl 库 预先编译好的包: sudo apt- ...

  6. centos7安装Docker详细步骤(无坑版教程)

    一.安装前必读 在安装 Docker 之前,先说一下配置,我这里是Centos7 Linux 内核:官方建议 3.10 以上,3.8以上貌似也可. 注意:本文的命令使用的是 root 用户登录执行,不 ...

  7. 全网最详细的基于Ubuntu14.04/16.04 + Anaconda2 / Anaconda3 + Python2.7/3.4/3.5/3.6安装Tensorflow详细步骤(图文)(博主推荐)

    不多说,直接上干货! 前言 建议参照最新的tensorflow安装步骤(Linux,官方网站经常访问不是很稳定,所以给了一个github的地址):         https://github.com ...

  8. Linux下python安装升级详细步骤 | Python2 升级 Python3

    Linux下python升级步骤  Python2 ->Python3 多数情况下,系统自动的Python版本是2.x 或者yum直接安装的也是2.x 但是,现在多数情况下建议使用3.x 那么如 ...

  9. Linux下python安装升级详细步骤 | Python2 升级 Python3 转载

    Linux下python升级步骤  Python2 ->Python3 多数情况下,系统自动的Python版本是2.x 或者yum直接安装的也是2.x 但是,现在多数情况下建议使用3.x 那么如 ...

随机推荐

  1. c++课程设计(日历)

    今天比较无聊,就随便找了个程序设计来做,下面是源代码,以及效果图...不喜请喷!/*题目1:年历显示. 功能要求: (1) 输入一个年份,输出是在屏幕上显示该年的日历.假定输入的年份在1940-204 ...

  2. HDUOJ--1058HangOver

    HangOver Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  3. Spring MVC+Mybatis 执行存储过程,使用Map进行参数的传递

    研究了一天mybatis如何执行存储过程,基本了解了ORM的设计思想,在map层面进行对象关系映射有两种思路. 根据不同的业务使用不同的思路: 一.实体类和数据库映射,就是将数据库中的字段和java实 ...

  4. Chart.js 学习笔记

    1.引入Chart.js 文件 <script src="Chart.js"></script> 2.在html中创建画布 <canvas id=&q ...

  5. Report_SRW工具的基本用法(概念)

    2014-05-31 Created By BaoXinjian

  6. 傅立叶级数(Fourier Series)和周期现象

    一.前言 如果你仔细观察,工作和生活中充满了周期现象:旁边linux driver工程师在调试audio driver的时候播放的1kHz的正弦信号,周末去公园游玩,游船推开水面的波纹,硬件工程师调试 ...

  7. C#实现相似QQ的隐藏浮动窗口、消息闪动

    功能简单介绍 当语音客服系统登录成功进入主界面时,本聊天工具将会自己主动隐藏在左下角位置,当鼠标移动到左下角时,自己主动弹出,当鼠标移开聊天窗口时,自己主动隐藏.假设想让聊天窗口固定在桌面.仅仅要拖动 ...

  8. python标准库介绍——9 copy模块详解

    ==copy 模块== ``copy`` 模块包含两个函数, 用来拷贝对象, 如 [Example 1-64 #eg-1-64] 所示. ``copy(object) => object`` 创 ...

  9. ansible 一些参数的整理

    用ansible 来管理远程的主机,最大的好处是方便,ansible不用在远程的主机上安装ansible的客户端,ansible只要能通过ssh连接上远程主机就 能对它进行管理.也就是说ansible ...

  10. ActiveMQ + NodeJS + Stomp 入门

    NodeJS + stomp-client 入门 准备 下载ActiveMQ并安装 执行bin\win32\activemq.bat启动MQ服务 打开http://localhost:8161/adm ...