Countless pits in the redmine installation process

I saw redmine on the Internet and felt very powerful. So I started to install it myself, but who would have thought of the pits in the installation process, and I fell all over with bruises and wounds, so I made a summary by myself, hoping that others could bypass these pits and go straight.

1. Installation environment: System: ubutu12.04 Architecture: LAMP Security: Firewall and selinix (all closed)

2. Installation process: A. Install ruby ​​#Official website to download the version above ruby-2.2, otherwise the components during the installation process will not be installed. (Take 2.2.4 as an example)
# tar zxvf ruby-2.2.4.tar.gz         
# cd ruby-2.2.4
# ./configure 
# make && make install
Set the Ruby environment variable

vim ~/.profile
export PATH=$PATH:/usr/local/src/ruby-2.2.4/       

B.安装rubygems                                                                                                                                                 # tar zxvf rubygems-2.6.6.tgz
# cd rubygems-2.6.6
# ruby setup.rb

C. Install dependencies: apt-get install libmysqlclient-dev apache2-threaded-dev

 

D. Install redmine

 官网下载 redmine-2.4.3.tar.gz
#tar zxf redmine-2.4.3.tar.gz
#./configure                                                                                                                                                   #make &&make install                                                                                                                                       # mv redmine-2.4.3   /usr/local/redmine                           

                                                                                                                                                                                      E.gem component installation: 1. gem install bundler The installation process needs to change the source (otherwise the installation is very slow): gem sources --remove https://rubygems.org/ gem sources -a https://ruby.taobao.org/ During the installation process may appear: error -->Can't find Magick-config Check the content of the prompt log and find: find_executable: checking for Magick-config... -------------------- no Solution: sudo apt-get install libmagickwand-dev imagemagick and install it again: gem install bundler

3. Modify the redmine source package: Gemfile, replace https://rubygems.org with https://ruby.taobao.org (beginning) 
#bundle install --without development test postgresql sqlite rmagick ******* ************************Gemfile.lock.****************** will be generated after installation is complete ********************************
Detailed explanation:
     Gemfile is a place to specify which gems and their versions need to be used; Gemfile. The lock file is where Bundler keeps track of which versions have been installed. This way, when the same library/project is deployed on another machine, running bundle install will look at the Gemfile.lock and install the same version instead of using the Gemfile and installing the latest version. (running different versions on different machines will cause tests to fail...) You don't need to change Gemfile.lock.********************** directly **************************************************** ********************************

F. Database configuration: 1. Create database and add user #create database redmine character set utf8;
       #create user 'redmine'@'localhost' identified by '123456'; #grant all privileges on redmine.* to 'redmine' @'localhost'; 2.Database configuration file (/usr/local/redmine/config): Modify the database configuration file
       #cd config
       #cp database.yml.example database.yml
       #vim database.yml (修改database.yml文件如下:)
       #production:
       #adapter: mysql2
       #database: redmine
       #host: localhost
       #username: redmine
       #password: 123456
       #encoding: utf8
3.rake generate_secret_token #Generate the config/initializers/secret_token.rb file. In redmine-2.4.3, this file does not exist beforehand. If it exists beforehand, delete it. ******a) It may appear here that the rake version is too low, gem install rake -v 'version number', and then bundle install again (the version of ralis is low, which is also solved as above) b) The installation may be Report rake aborted! rbpdf-font cannot be loaded, install manually: gem install rbpdf-font ****************************** **************************** 4. Database initialization (×**** Note that the directory at this time must be in redmine/config ×) #rake db:migrate RAILS_ENV="production"
This default setting is only the interface language when the user is not logged in. When the user logs in, the default language is still English, which can be changed to other languages ​​in My account.

The connection between G.apache/nginx (here takes apache as an example): 1. Modify file permissions: chmod -R 777 files log tmp public/plugin_assets (/usr/local/redmine)                                  

2. Add apache/nginx module: #gem install passenger #cd /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30/bin
       #passenger-install-apache2-module **** *********Here depends on the situation to see apxs2 in apache: /usr/bin/apxs2 and Executable: /usr/sbin/apache2 Use the above command directly, if it is a source installation: passenger-install-apache2 -module --apxs2-path "/usr/local/apache/bin/apxs" The characters in quotes are the source installation apache location. **************************************************** ************************

H.apache configuration file content: 1. Module loading (this content will display the relevant content after the installation in the previous step, just copy it to the configuration file)

LoadModule passenger_module /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30
     PassengerDefaultRuby /usr/local/bin/ruby
   </IfModule>

<IfModule unixd_module>

  2.apache URL settings

<VirtualHost *:80>
      ServerName ip地址
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot "/usr/local/redmine/public"
      ErrorLog  "/tmp/redmine_error_log"
</VirtualHost>

 

I restart apache, start mysql, http://ip to access the website.

Username: admin Password: admin

A screenshot (please be happy):
    

The above is the installation process, I hope you can avoid detours.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324441108&siteId=291194637