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
- Wgetftp: // ftp.ruby-lang.org//pub/ruby/1.8/ruby-1.8.7.tar.gz
- Wgethttp: // production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz
- Wgethttp: // rubyforge.org/frs/download.php/74944/redmine-1.2.0.tar.gz
- Wgethttp: // subversion.tigris.org/downloads/subversion-1.6.17.tar.gz
- 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:
- Tarzxvfruby-1.8.7.tar.gz
- Cdruby-1.8.7
- ./Configure -- prefix =/usr/local/ruby
- Make & makeinstall
- Cd ..
- Modify ~ /. Bash_profile: add the ruby directory to the root environment variable.
- 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
- Tarzxvfrubygems-1.6.2.tgz
- Cdrubygems-1.6.2
- Rubysetup. rb
- Cd ..
3. Install rails rack i18n mysql passenger
- Geminstallrails-v = 2.3.11
- Geminstallrack-v = 1.1.1
- Geminstalli18n-v = 0.4.2
- Geminstallmysql -- no-rdoc -- no-ri ---- with-mysql-dir =/data/soft/mysql # My mysql is compiled and installed in the/data/soft/mysql directory.
- Geminstallpassenger
- Geminstallmongrelmongrel_cluster
Iv. install and configure redmine
1. Decompress redmine
- Tarzxvfredmine-1.2.0.tar.gz
- Mvredmine-1.2.0/data/www/redmine
- Chown-Rwww./data/www/redmine
2. Create a database
- /Data/soft/mysql/bin/mysql-uroot-p
- Mysql> createdatabaseredminecharactersetutf8;
- Mysql> grantallonredmine. * to 'redmine '@ 'localhost' identifiedby 'redmine ';
- Mysql> flushprivileges;
3. Modify the redmine mysql database configuration.
- Cd/data/www/redmine/config
- Cpdatabase. yml. exampledatabase. yml
- Vidatabase. yml
- Production:
- Adapter: mysql
- Database: redmine
- Host: localhost
- Username: redmine
- Password: redmine
- Encoding: utf8
Note: there is a space after the colon...
4. Create a running database:
Generate a session storage key:
- Cd/data/www/redmine
- Rakegenerate_session_store
Then, create the database table structure and run it in the root directory of redmine:
- RAILS_ENV = productionrakedb: migrate
Read the default configuration data. When you Select language, Select zh:
- RAILS_ENV = productionrakeredmine: load_default_data
5. Configure mongrel_cluster
- Cd/data/www/redmine
- Mongrel_railscluster: configure-eproduction-p8000-a127.0.0.1-N3
6. Enable mongrel_cluster
- Cd/data/www/redmine
- Mongrel_railscluster: start
If an error occurs during startup:
- Startingport8000
- !!! Pathtopidfilenotvalid: tmp/pids/mongrel.8000.pid
- Mongrel: startreportedanerror. Usemongrel_railsmongrel: start-htogethelp.
- Startingport8001
- !!! Pathtopidfilenotvalid: tmp/pids/mongrel.8001.pid
- Mongrel: startreportedanerror. Usemongrel_railsmongrel: start-htogethelp.
- Startingport8002
- !!! Pathtopidfilenotvalid: tmp/pids/mongrel.8002.pid
- Mongrel: startreportedanerror. Usemongrel_railsmongrel: start-htogethelp.
Create the/data/www/redmine/tmp/pids directory.
- Mkdir-p/data/www/redmine/tmp/pids
The startup is successful as follows:
- [Root @ CentOS5redmine] # mongrel_railscluster: start
- Startingport8000
- Startingport8001
- Startingport8002
7. Configure nginx
- Vi/data/soft/nginx/conf/nginx. conf
- Upstreammongrel
- {
- Server127.0.0.1: 8000;
- Server127.0.0.1: 8001;
- Server127.0.0.1: 8002;
- }
- Server
- {
- Listen80;
- Server_name192.168.8.32;
- Root/data/www/redmine;
- Indexindex.htmlindex.htm;
- Location/
- {
- Proxy_passhttp: // mongrel;
- Proxy_redirectoff;
- Proxy_set_headerHost $ host;
- The proxy_set_headerX-Real-IP $ remote_addr;
- Proxy_set_headerX-Forwarded-For $ proxy_add_x_forwarded_for;
- }
- }
V. Test redmine access:
- Http: // 192.168.8.32
You can use ruby's built-in webrick to launch redmine.
- /Usr/local/ruby/bin/ruby/data/www/redmine/script/serverwebrick-eproduction &
The startup is successful as follows:
- [Root @ CentOS5redmine] #/usr/local/ruby/bin/ruby/data/www/redmine/script/serverwebrick-eproduction &
- [1] 3526
- [Root @ CentOS5redmine] # => BootingWEBrick
- => Rails2.3.11applicationstartingonhttp: // 0.0.0.0: 3000
- => Callwith-dtodetach
- => Ctrl-Ctoshutdownserver
- [2011-06-2409: 30: 47] INFOWEBrick1.3.1
- [2011-06-2409: 30: 47] INFOruby1.8.7 () [i686-linux]
- [2011-06-2409: 30: 47] INFOWEBrick: HTTPServer # start: pid = 3526 port = 3000
Test redmine access: http: // 192.168.8.32: 3000