CentOS 6.5下Redmine的安装配置(2)

<VirtualHost *:80>
      ServerName 192.168.3.126
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /data/redmine-2.6.3/public
  ErrorLog logs/redmine_error_log
      <Directory /data/redmine-2.6.3/public>
<span> </span> Options Indexes ExecCGI FollowSymLinks
        Order allow,deny
        Allow from all
        # This relaxes Apache security settings.
        AllowOverride all
        # MultiViews must be turned off.
        Options -MultiViews
        # Uncomment this if you're on Apache >= 2.4:
        #Require all granted
      </Directory>
  </VirtualHost>

不要忘了service httpd restart

9.redmine相关配置

cd /data/redmine-2.6.3/public

cp database.yml.example database.yml

注意:官网中说MySQL database using ruby 1.9 (adapter must be set to mysql2)

vim database.yml
production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "redmine"
  encoding: utf8

10.安装rails,安装过程中会出现很多问题,我们来一一解决吧。 

cd /data/redmine-2.6.3

gem install bundler

bundle install 

这里会报错:

An error occurred while installing rack-cache (1.2), and Bundler cannot continue.
Make sure that `gem install rack-cache -v '1.2'` succeeds before bundling.

我们按照提示安装所需组件 

gem install rack-cache -v '1.2'

然后再次bundle install,报错:

An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.

按照提示gem install nokogiri -v '1.6.6.2',再运行bundle install,报错:

ERROR:  Error installing nokogiri:
 ERROR: Failed to build gem native extension.

按照提示: 

If you are using Bundler, tell it to use the option:
 
    bundle config build.nokogiri --use-system-libraries
    bundle install

我们来输入命令:

bundle config build.nokogiri --use-system-libraries
  bundle install

再次报错:

An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.

按照提示安装 gem install json -v '1.8.2',然后再次bundle install

又报错:

An error occurred while installing railties (3.2.21), and Bundler cannot continue.
Make sure that `gem install railties -v '3.2.21'` succeeds before bundling.

按照提示安装 gem install railties -v '3.2.21',然后再次bundle install 

又报错:

An error occurred while installing mysql2 (0.3.18), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.18'` succeeds before bundling.

执行gem install mysql2 -v '0.3.18'报错:

checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing

我们执行yum install mysql-devel后成功安装,接着bundle install 

报错:

An error occurred while installing redcarpet (2.3.0), and Bundler cannot continue.
Make sure that `gem install redcarpet -v '2.3.0'` succeeds before bundling.

按照提示安装 gem install redcarpet  -v '2.3.0',然后再次bundle install

Please report any bugs. See https://github.com/gemhome/rmagick/compare/RMagick_2-13-2...master and https://github.com/rmagick/rmagick/issues/18

ok,终于安装成功。 

rake generate_secret_token

初始化redmine数据库表名

RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

11.修改fastcgi‘

cd /data/redmine-2.6.3/public
mkdir plugin_assets
cp dispatch.fcgi.example dispatch.fcgi
cp htaccess.fcgi.example .htaccess

12.安装mod_fcgi

rpm --import https://Fedoraproject.org/static/0608B895.txt
wget
rpm -ivh epel-release-6-8.noarch.rpm
yum -y install mod_fcgid

13.创建文件目录

mkdir -p /data/redmine-2.6.3/files
cd /data/redmine-2.6.3/config
cp configuration.yml.example configuration.yml

由于我们的files目录在redmine根目录下,因此configuration不用配置了,如果files目录在其他地方,我们需要 

vim configuration.yml
attachments_storage_path: /var/redmine/files

14.最后启动redmine

cd /data/redmine-2
chown -R apache:apache redmine-2.6.3
chmod -R 755 redmine-2.6.3
service httpd restart

测试吧,让我们访问下看看

CentOS 6.5下Redmine的安装配置

默认的用户名和密码都为admin

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/8df916facc6a9d05175794b9d8632a4b.html