CentOS5.5 build Redmine + SVN and integrate it into nginx

Source: Internet
Author: User
Tags i18n redmine

CentOS5.5 build Redmine + SVN and integrate it into nginx

Redmine: A web-based project management software developed using Ruby. It is a cross-platform project management system developed based on the ROR framework. It is a rising star in the project management system. It is said that it comes from the ror version of Basecamp and supports multiple databases, in addition to the functions of DotProject, there are also many unique functions, such as providing wiki, news platform, time tracking, feed aggregation, and exporting pdf, you can also integrate other version management systems and BUG tracking systems, such as SVN, CVS, and TD. The configuration is powerful and convenient, and custom attributes and update notifications are also very useful. Next we will deploy the redmine + svn Project Management System (the corresponding ruby package needs to be installed strictly according to the official installation documentation)

Environment: centos-5.5redmine-1.2.0 subversion-1.6.17

1. download the required software package

  1. Wgetftp: // ftp.ruby-lang.org//pub/ruby/1.8/ruby-1.8.7.tar.gz
  2. Wgethttp: // production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz
  3. Wgethttp: // rubyforge.org/frs/download.php/74944/redmine-1.2.0.tar.gz
  4. Wgethttp: // subversion.tigris.org/downloads/subversion-1.6.17.tar.gz
  5. Wgethttp: // subversion.tigris.org/downloads/subversion-deps-1.6.17.tar.gz

2. Configure the LNMP environment first

Reference: Install mysql5.1.57 + php5.2.17 (FastCGI) + nginx1.0.1 High-Performance Web server in CentOS 5.5

Iii. redmine installation (the software package version requirements are very strict and must correspond to the corresponding version; otherwise, unpredictable errors may occur)

1. ruby installation:

  1. Tarzxvfruby-1.8.7.tar.gz
  2. Cdruby-1.8.7
  3. ./Configure -- prefix =/usr/local/ruby
  4. Make & makeinstall
  5. Cd ..
  6. Modify ~ /. Bash_profile: add the ruby directory to the root environment variable.
  7. Or echo "exportPATH = $ PATH:/usr/local/ruby/bin/">/etc/profile

2. rubygems Installation

Install rubygems. Note that the version must be earlier than 1.7.0. Otherwise, redmine cannot be started normally. Because I read a Chinese document written by someone else and installed version 1.7.0, redmine has been unable to work normally, so it took a big detour. Finally, the problem is found in the official documentation. The following describes the version requirements on the official website.
Ruby 1.9 is not supported yet. You have to use Ruby 1.8.x as stated above.
RubyGems 1.3.7 or higher is required with following limitations:
Rails 2.3.5 will fail with RubyGems 1.5.0 or later, stick to previous versions of RubyGems!
Rails 2.3.11 will fail with RubyGems 1.7.0 or later, stick to previous versions of RubyGems!
Rake 0.8.7 is required (rake 0.9.x is not supported by Rails yet)
Rack 1.1.x is required, 1.1.0 has a bug with quotes (#8416). Database migration wowould fail with other version.
Mongrel 1.1.5 needs a patch attached to #7688 to work fine with Rails 2.3.11. In case of upgrade, another issue may appear for some time after migration (#7857 ).
I18n 0.4.2 is required for Redmine> = 1.0.5

  1. Tarzxvfrubygems-1.6.2.tgz
  2. Cdrubygems-1.6.2
  3. Rubysetup. rb
  4. Cd ..

3. Install rails rack i18n mysql passenger

  1. Geminstallrails-v = 2.3.11
  2. Geminstallrack-v = 1.1.1
  3. Geminstalli18n-v = 0.4.2
  4. Geminstallmysql -- no-rdoc -- no-ri ---- with-mysql-dir =/data/soft/mysql # My mysql is compiled and installed in the/data/soft/mysql directory.
  5. Geminstallpassenger
  6. Geminstallmongrelmongrel_cluster

Iv. install and configure redmine

1. Decompress redmine

  1. Tarzxvfredmine-1.2.0.tar.gz
  2. Mvredmine-1.2.0/data/www/redmine
  3. Chown-Rwww./data/www/redmine

2. Create a database

  1. /Data/soft/mysql/bin/mysql-uroot-p
  2. Mysql> createdatabaseredminecharactersetutf8;
  3. Mysql> grantallonredmine. * to 'redmine '@ 'localhost' identifiedby 'redmine ';
  4. Mysql> flushprivileges;

3. Modify the redmine mysql database configuration.

  1. Cd/data/www/redmine/config
  2. Cpdatabase. yml. exampledatabase. yml
  3. Vidatabase. yml
  4. Production:
  5. Adapter: mysql
  6. Database: redmine
  7. Host: localhost
  8. Username: redmine
  9. Password: redmine
  10. Encoding: utf8

Note: there is a space after the colon...

4. Create a running database:

Generate a session storage key:

  1. Cd/data/www/redmine
  2. Rakegenerate_session_store

Then, create the database table structure and run it in the root directory of redmine:

  1. RAILS_ENV = productionrakedb: migrate

Read the default configuration data. When you Select language, Select zh:

  1. RAILS_ENV = productionrakeredmine: load_default_data

5. Configure mongrel_cluster

  1. Cd/data/www/redmine
  2. Mongrel_railscluster: configure-eproduction-p8000-a127.0.0.1-N3

6. Enable mongrel_cluster

  1. Cd/data/www/redmine
  2. Mongrel_railscluster: start

If an error occurs during startup:

  1. Startingport8000
  2. !!! Pathtopidfilenotvalid: tmp/pids/mongrel.8000.pid
  3. Mongrel: startreportedanerror. Usemongrel_railsmongrel: start-htogethelp.
  4. Startingport8001
  5. !!! Pathtopidfilenotvalid: tmp/pids/mongrel.8001.pid
  6. Mongrel: startreportedanerror. Usemongrel_railsmongrel: start-htogethelp.
  7. Startingport8002
  8. !!! Pathtopidfilenotvalid: tmp/pids/mongrel.8002.pid
  9. Mongrel: startreportedanerror. Usemongrel_railsmongrel: start-htogethelp.

Create the/data/www/redmine/tmp/pids directory.

  1. Mkdir-p/data/www/redmine/tmp/pids

The startup is successful as follows:

  1. [Root @ CentOS5redmine] # mongrel_railscluster: start
  2. Startingport8000
  3. Startingport8001
  4. Startingport8002

7. Configure nginx

  1. Vi/data/soft/nginx/conf/nginx. conf
  2. Upstreammongrel
  3. {
  4. Server127.0.0.1: 8000;
  5. Server127.0.0.1: 8001;
  6. Server127.0.0.1: 8002;
  7. }
  8. Server
  9. {
  10. Listen80;
  11. Server_name192.168.8.32;
  12. Root/data/www/redmine;
  13. Indexindex.htmlindex.htm;
  14. Location/
  15. {
  16. Proxy_passhttp: // mongrel;
  17. Proxy_redirectoff;
  18. Proxy_set_headerHost $ host;
  19. The proxy_set_headerX-Real-IP $ remote_addr;
  20. Proxy_set_headerX-Forwarded-For $ proxy_add_x_forwarded_for;
  21. }
  22. }

V. Test redmine access:

  1. Http: // 192.168.8.32


You can use ruby's built-in webrick to launch redmine.

  1. /Usr/local/ruby/bin/ruby/data/www/redmine/script/serverwebrick-eproduction &

The startup is successful as follows:

  1. [Root @ CentOS5redmine] #/usr/local/ruby/bin/ruby/data/www/redmine/script/serverwebrick-eproduction &
  2. [1] 3526
  3. [Root @ CentOS5redmine] # => BootingWEBrick
  4. => Rails2.3.11applicationstartingonhttp: // 0.0.0.0: 3000
  5. => Callwith-dtodetach
  6. => Ctrl-Ctoshutdownserver
  7. [2011-06-2409: 30: 47] INFOWEBrick1.3.1
  8. [2011-06-2409: 30: 47] INFOruby1.8.7 () [i686-linux]
  9. [2011-06-2409: 30: 47] INFOWEBrick: HTTPServer # start: pid = 3526 port = 3000

Test redmine access: http: // 192.168.8.32: 3000

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.