linux下安装redmine1.2.1全记录

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

一、安装ruby

下载ruby-1.8.7

http://www.ruby-lang.org/en/downloads

 

#tar xzvf ruby-1.8.7.tar.gz

#cd ruby-1.8.7

#./configure --prefix=/usr/local/ruby

#make && make install

 

设置环境变量     vim /etc/profile

export PATH=/usr/local/ruby/bin:$PATH

二、安装rubygems

如果系统中已经存在rubygems,可以通过如下方法卸载:

#ruby -e 'puts $:'//查找rubygems安装目录

#cd /usr/local/ruby/lib/ruby/site_ruby/1.8/

#rm -rf ubygems.rb rubygems rubygems.rb 

#which gem gem1.8//查找gem包的安装目录

#rm -rf /usr/local/ruby/bin/gem

下载rubygems-1.6.0

https://rubyforge.org/frs/?group_id=126&release_id=46730

#tar zxvf rubygems-1.6.0.tgz

#cd rubygems-1.6.0

#ruby setup.rb

#gem -v//查看版本

注意:开始时把rubygems更新到最新版本1.6.2了,最后用rake创建表时失败,郁闷。

       安装完rubygems后注意修改更新站点,否则有的包可能无法正常安装。

        #gem source -r http://gems.rubyforge.org       删除以前的更新站点

        #gem source -a http://rubygems.org                添加现在的更新站点

 

三、安装rails

#gem install rails -v=2.3.11

      

四、安装i18n

#gem install i18n -v=0.4.2

Fetching:i18n-0.4.2.gem (100%)

Successfully installed i18n-0.4.2

1 gem installed

Installing ri documentation for i18n-0.4.2...

Installing RDoc documentation for i18n-0.4.2...

 

五、安装ruby-mysql

#gem install ruby-mysql

Successfully installed ruby-mysql-2.9.4

1 gem installed

Installing ri documentation for ruby-mysql-2.9.4...

Installing RDoc documentation for ruby-mysql-2.9.4...

 

六、补充 mysql的安装:

创建mysql用户名,用户组

# groupadd mysql

# usradd -g mysql mysql

 

下载mysql源码 http://www.mysql.com/downloads/mysql

 

#cd mysql-5.0.22

#./configure --prefix=/usr/local/mysql

--datadir=/mydata //数据库存放目录

--with-charset=utf8 //使用UTF8格式

--with-extra-charsets=complex //安装所有的扩展字符集

--enable-thread-safe-client //启用客户端安全线程

--with-big-tables //启用大表

--with-ssl //使用SSL加密

--with-embedded-server //编译成embedded MySQL library (libmysqld.a )

--enable-local-infile //允许从本地导入数据

--enable-assembler //汇编x86的普通操作符,可以提高性能

--with-plugins=innobase //数据库插件

--with-plugins=partition //分表功能,将一个大表分割成多个小表

#make && make install

 

初始化mysql数据库

#chown -R mysql:mysql /usr/local/mysql

#cp mysql-5.0.22/support-files/my-medium.cnf /etc/my.cnf

#cd /usr/local/mysql

#bin/mysql_install_db --user=mysql

#chown -R mysql:mysql /usr/local/mysql/var/ //把初始化的数据库目录给MySQL所有者

#/usr/local/mysql/bin/mysqld_safe --user=mysql & //启动MySQL

 

配置开机自动启动

#cp mysql-5.0.22/support-files/mysql.server /etc/init.d/mysqld

#chmod 755 /etc/init.d/mysqld

#chkconfig --add mysqld

#chkconfig mysqld on

#service mysqld restart

 

补充 mysql的配置:

配置my.cnf

配置主要把安装的目录的那几项打开就行.

改动如下:

[client]

#password = your_password

port = 3306

socket = /tmp/mysql3306.sock

 

# The Mysql server

[Mysqld]

port = 3306

socket = /tmp/mysql3306.sock

 

打开下面几项

innodb_data_home_dir = /usr/local/mysql/var/

innodb_data_file_path = ibdata1:10M:autoextend

innodb_log_group_home_dir = /usr/local/mysql/var/

innodb_log_arch_dir = /usr/local/mysql/var/

 

七、安装redmine

http://rubyforge.org/frs/?group_id=1850 

注意redmine的版本,此处是以1.2.1为例子的

 

具体版本信息要求请看http://www.redmine.org/projects/redmine/wiki/RedmineInstall?version=146

 

下载redmine-1.2.1

解压放到/usr/local/redmine下

 

#cd /usr/local/redmine/config

 

#cp database.yml.example database.yml

 

#vim database.yml  //数据库配置文件

 

production:  

adapter: mysql  

database:redmine  

host: localhost  

username: root          //数据库访问用户名

password: "123456"    //数据库访问密码

encoding: utf8

 

使用rake创建表

# rake db:migrate RAILS_ENV="production" 

 

a.报错:uninitialized constant ActiveSupport::Dependencies::Mutex 

解决方法:rails和rubygems版本不匹配,rubygems降到1.3.5试试

 

b.报错:A key is required to write a cookie containing the session data. Use config.action_controller.session = {:key=>"_myapp_session", :secret=> "some secret phrase" } in config/environment.rb

解决方法:rake config/initializers/session_store.rb

 

c.报错: No such file or directory - /tmp/mysql.sock

解决方法: 由于之前在mysql配置时my.cnf配置了socket导致

vim config/database.yml

在production栏目最后一行添加 socket: /tmp/mysql3306.sock  

注意: socket的“:"后面必须有个空格,再接"/tmp/mysql3306.sock"

 

d.报错:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.

rake aborted!

需要安装mysql适配器。gem install mysql

 

e.报错:

Access denied for user 'mysql'@'localhost' (using password: YES)

解决办法:

#mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.0.22-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 

mysql>grant all privileges on *.* to 'mysql'@'localhost' identified by 'mysql' with grant option; 

mysql>flush privileges;

mysql>exit;

    

f.报错:Unknown database 'redmine'

解决办法:创建数据库redmine

mysql>create database redmine;

         

加载默认配置

# rake redmine:load_default_data RAILS_ENV="production"

这里会要求选择默认语言,选中文zh:

Select language: bg, ca, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, lt, nl, no, pl, pt, pt-br, ro, ru, sk, sr, sv, th, tr, uk, vn, zh, zh-tw [en] zh

这个默认设置只是在未登录时的界面语言,当用户登录后,默认语言还是英语,在My account里可以修改成其它语言。

 

启动WEB服务

# ruby script/server webrick -e production

或# ruby /usr/local/redmine/redmine-1.0/script/server webrick -e production

更换web服务器

redmine自带的webrick太慢,特别是局域网,据说是需要解析目标地址的主机名,直接给ip不用,硬要绕一圈。

 

使用网上推荐的 mongrel

# gem install mongrel

# ruby /usr/local/redmine/script/server mongrel -e production

本机ip为192.9.100.106,至此在本机使用http://192.9.100.106:3000 或 http://127.0.0.1:3000均能访问,但局域网其他机器仍然无法访问。

 

原因:redhat防火墙屏蔽了端口3000

解决办法: 配置防火墙,开放宽口3000                

# /sbin/iptables -I INPUT -p tcp --dport 3000 -j ACCEPT

# /etc/rc.d/init.d/iptables save

# service iptables restart

至此,redmine安装完成。

 

八、Redmine邮件的配置

 

进入config目录下

cp configuration.yml.example configuration.yml

然后修改信息如下:

 

default:

  # Outgoing emails configuration (see examples above)

  email_delivery:

    delivery_method: :async_smtp

    smtp_settings:

      #tls: true

      address: smtp.XXX.com

      port: 25

      domain: XXX.com

      authentication: :login

      user_name: "XXX@XXX.com"

      password: "XXX"

 

重启服务,然后在redmine的管理》配置》邮件通知中开启即可










本文转自 小强测试帮 51CTO博客,原文链接:http://blog.51cto.com/xqtesting/909355,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3天前
|
Linux 开发工具 C语言
Linux 安装 gcc 编译运行 C程序
Linux 安装 gcc 编译运行 C程序
21 0
|
3天前
|
Ubuntu Linux Python
Linux(15)Ubuntu安装ninja构建工具
Linux(15)Ubuntu安装ninja构建工具
13 0
|
6天前
|
NoSQL Linux 测试技术
Redis的安装(Linux版)
Redis的安装(Linux版)
149 1
|
16天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
81 0
|
16天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
36 0
|
16天前
|
NoSQL Linux Redis
linux 下和win下安装redis 并添加开机自启 图文详解
linux 下和win下安装redis 并添加开机自启 图文详解
17 0
|
16天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
52 0
|
28天前
|
Java Linux Maven
Linux中安装MAVEN环境配置
Linux中安装MAVEN环境配置
63 3
|
2天前
|
监控 安全 Linux
Linux系统之安装ServerBee服务器监控工具
【4月更文挑战第22天】Linux系统之安装ServerBee服务器监控工具
39 2
|
2天前
|
Linux 开发工具 Android开发
Docker系列(1)安装Linux系统编译Android源码
Docker系列(1)安装Linux系统编译Android源码
5 0