Install and configure redmine in centos

Source: Internet
Author: User
Tags i18n redmine
The installation and configuration of redmine under centos-general Linux technology-Linux technology and application information. The following is a detailed description. 1. First install some related libraries
Yum groupinstall "Development Tools"

Yum install zlib-devel wget openssl-devel pcre-devel make gcc-c ++ curl-devel

2. Since it is written in ruby, ruby always needs to be installed. The latest version of ruby is 1.9.x, but the latest version of redmine 1.1 only supports version ruby1.8. Therefore, you need to install ruby 1.8.x.
Wget ftp://ftp.ruby-lang.org//pub/ruby/ruby-1.8.7-p352.tar.gz
Tar-xvzf ruby-1.8.7-p334.tar.gz
Cd ruby-1.8.7-p334
./Configure? Prefix =/usr/local/ruby
Make
Make install

3. Install rubygems. This stuff should be similar to the perl module, which I understand.
Wget http://production.cf.rubygems.org/rubygems/rubygems-1.5.1.tgz
Tar-zxvf rubygems-1.5.1.tgz
Cd rubygems-1.5.1/
Ruby setup. rb


After the installation is complete, remember to set the PATH environment variable and add/usr/local/ruby/bin to run ruby.
Directly edit the/etc/environment file and modify the PATH environment variable. This method takes effect only after the system is restarted.
It can be set:
PATH =. :/bin:/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/ruby/bin: /usr/local/mysql/bin

4. install some libraries required for redmine running with gem
Gem install rails
{Optional
Gem update -- system
Gem install rake rack
Gem install i18n
Gem install RedCloth
Gem install fastthread -- no-rdoc -- no-ri
}
Gem install mysql -- no-rdoc -- no-ri -- with-mysql-dir =/usr/bin -- with-mysql-lib =/usr/lib/mysql -- with-mysql -include =/usr/include/mysql


6. Download redmine
Svn co http://redmine.rubyforge.org/svn/branches/1.1-stable redmine-1.1
Cp-rf redmine-1.1/home/httpd/redmine

7. Run the following command to install MySQL C bindings:
Gem install mysql
This command will install MySQL C bindings online, which can significantly improve the performance of accessing the database

8. Create a database. I use mysql and redmine also supports other databases.
Open the Windows command line and switch to the Bin directory under the Mysql installation directory (I am a little white, but do not talk about this switch ?), Then run the following command to enter the MySQL command line:
Mysql? U root-p
Enter the server password and log on to mysql. Then, the command line prompt will be switched to "mysql>", indicating that the logon is successful.
4. Run the following command in MySQL command line mode to create a Redmine database:
Create database redmine character set utf8;
Press enter to create a database for Redmine.
PS: the command line of the Mysql database must end with ";" before execution. If you have never touched MySQL, the key is P (because I am stuck here)
5. Create a Redmine database user and password, and grant permissions: (you must change the user name, server name, and password between the quotation marks)
Create user 'redmine '@ 'localhost' identified by 'my _ password ';
If no error message is displayed, the creation is successful.
Perform the following authorization operations:
Grant all privileges on redmine. * to 'redmine '@ 'localhost ';
PS: if an error occurs when creating a user, run the following command to delete the user:
Drop user 'redmine '@ 'localhost ';


3. Set redmine database Parameters
We use the example provided by redmine as a blueprint to go to the directory where redmine is located: cp config/database. yml. example config/database. yml
Edit the config/database. yml file, find the production Section, set the username and password to, and save the file. Note that there must be a space between the setting item and the colon (:). Otherwise, an error will occur.
4. Generate a session storage key:
RAILS_ENV = production rake config/initializers/session_store.rb
If the following exception occurs:
Rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2 +)
WARNING: 'Task: t, arg,: needs => [deps] 'is deprecated. Please use' task: t ,[
Args] => [deps] 'instead.
At D:/Downloads/ruby/redmine-1.1.3/lib/tasks/email. rake: 170

This is because the rake version is too high.
Solution:
Run the gem list rake command to view the rake version. If it is higher than 0.8.7, it is too high (for example, 0.9.0 ).
In this case, you need to uninstall 0.9.0 and install 0.8.7.
Gem uninstall rake-v = 0.9.0
Gem install rake-v = 0.8.7
Note: In Versions later than r3055, config/initializers/session_store.rb is removed and replaced by the following command.
Rake generate_session_store


Rake generate_session_store
Rake db: migrate RAILS_ENV = "production"
If the system prompts that the version is incorrect, install the following:
Gem install-v = 0.4.2 i18n
Gem install-v = 2.3.5 rails
Then run:
RAILS_ENV = production rake db: migrate

If the prompt is:
Rake aborted!
Undefined local variable or method 'version _ requirements '#

Just:
Vi/home/httpd/redmine/config/environment. rb
Add at the beginning:
If Gem: VERSION> = "1.3.6"
Module Rails
Class GemDependency
Def requirement
R = super
(R = Gem: Requirement. default )? Nil: r
End
End
End
End

Start redmine:
Ruby script/server webrick-e production &
Then you can access redmine through http: // ip: 3000 in the browser. The redmine installation is complete.

9. Run redmine with nginx
Although the above method can run redmine, It is very slow. After analysis, it is mainly slow in http processing. It can be seen from the running command above, redmine is equivalent to running on a web server written in ruby. Can it be slow...




The above problem is caused by the failure to execute the gem install mysql -- no-rdoc -- no-ri -- with-mysql-dir =/usr/bin -- with-mysql-lib =/usr/ lib/mysql -- with-mysql-include =/usr/include/mysql




Gem install mysql -- with-opt-dir =/usr/local/mysql/include/-- with-opt-lib =/usr/local/mysql/lib/-- with-mysql -config =/usr/local/mysql/bin/mysql_config
The mysql client package is required. Therefore, make sure that yum install mysql-devel is run before execution. However, because I installed mysql in the tar package, the following parameters are added as described above. Otherwise, * Object is not missing constant Issue may appear!
Sorry, I guess that's all you need!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.