Package redmine and deploy it to Tomcat: the steps for testing success are as follows.
The installation instructions on the official website are also clear, and there are good instructions for various situations. If e is good, you can follow the official website process.
Because I am not doing Ruby development, and I don't have the intention to change it, I chose JVM-based things.
1. Download redmine.
Official Website: http://www.redmine.org/
The latest version 1.4.1 ). Download and decompress the package to obtain a directory.
2. Configure the environment:
Versions later than 1.4.x can be supported using jruby. The requirements are as follows:
Redmine versionsupported Ruby into rails versionsupported rubygems versionscurrent trunkruby 1.8.7, 1.9.2, 1.9.3, jruby-1.6.7Rails license <= license 1.8.7, 1.9.2, 1.9.3, jruby-1.6.7Rails license <= 1.8 (1) jruby
Go to http://jruby.org/downloadto download the corresponding jruby, decompress it to the hard disk (usually select the Binary Package, too lazy to install, I use 1.6.7.2 ).
Then, modify the system variables and add the bin directory of jruby to path.
(2) rubygems
To https://rubyforge.org/frs? Group_id = 126 download the corresponding version of rubygems.
Note that the version of rubygems must not be later than 1.8 For redmine 1.4.1. I downloaded 1.8.0.
Decompress the package to the hard disk, open cmd, go to the rubygems directory, and enter jruby setup. RB.
After the installation is complete, check the version of rubygems with: gem-V
(3) rails
This is already included in redmine's gemfile and can be done with bundle.
How to install Bundle: Gem install bundler
Go to the directory where redmine is located and enter bundle install -- without development test.
In this way, all the gem packages required by redmine are installed, and the version is the same as required.
If any problem occurs, go to rubyforge to find and download the corresponding gem package and install it locally. Installation Method: Gem install [gem package file name]
3. Prepare the database:
Redmine currently supports MySQL, PostgreSQL, and SQLite databases.
(Oracle-supported methods are also available on the official website, but it seems that you have to change the ruby code, so you are too lazy to change it)
PostgreSQL has never been used. MySQL should be used by many people, and SQLite is the simplest.
(1) Create a database:
MySQL Configuration:
Create Database redmine Character Set utf8;
Create user 'redmine '@ 'localhost' identified by 'my _ password ';
Grant all privileges on redmine. * To 'redmine '@ 'localhost ';
For MySQL versions earlier than 5.0.2, use the following script:
Create Database redmine Character Set utf8;
Grant all privileges on redmine. * To 'redmine '@ 'localhost' identified by 'my _ password ';
In this way, a redmine database is added to MySQL to store data.
SQLite can skip this step. redmine will automatically create the SQLite database file.
(2) configure the database information in redmine:
Copy the database. yml. Example file in the redmine/config directory and rename it database. yml and edit the content.
The following sections starting with test in the file are examples of various database configurations. copy and paste them to production: Modify the following section to your own database information.
Note that if ruby1.9 is used, you need to change the adapter to mysql2.
4. Configure redmine:
(1) generate a session storage key
Run cmd to enter the following in the redmine directory:
Rake generate_session_store
If you need rdoc, install it with Gem install. If only this error is displayed and no other error is reported, the operation is successful. You can proceed to the next step.
(2) create a table structure in the database:
Rake DB: migrate rails_env = Production
You may need to install the libopenssl-ruby1.8 to complete this step.
(3) Insert initial data into the table:
This step is not required, but we strongly recommend that you do it because a database with no data is invisible.
Even if you want to define it yourself, you can modify it based on the data. Input:
Rake redmine: load_default_data rails_env = Production
(4) Set permissions:
If you are a Windows user, skip this step.
Running redmine must contain the following directories: files, log, and TMP.
Mkdir TMP public/plugin_assetssudo
Chown-r redmine: redmine files log TMP public/plugin_assetssudo
Chmod-r 755 files log TMP public/plugin_assets
At this point, redmine is configured. You can use the webrick server that comes with Ruby to try it:
Jruby script/Server webrick-e Production
Open the browser and enter http: // localhost: 3000 to view the logon page. Default Account: admin/admin
At this time, you can change the subject, logo, and code library. For details, refer to the howto section on the official website:
Http://www.redmine.org/projects/redmine/wiki/HowTos
5. Package and deploy it to Tomcat:
(1) install the tool for packaging:
Gem install warbler
(2) create a war package:
Run CMD in the redmine directory to enter:
Warble config
This will generate a warble. RB file under the config directory, edit the file, find the config. dirs line, and change it:
Config. dirs = % W (APP config lib log vendor TMP extra files Lang)
Contains all the directories you want to hit in the package. For the SQLite database, you may need to add the DB directory, because the database files are put here:
Config. dirs = % W (APP config lib log vendor TMP extra files Lang dB)
Then, remove the comment of config. Gems and change it:
Config. Gems + = ["activerecord-jdbcmysql-adapter", "jruby-OpenSSL", "i18n", "rack"]
Save the file, return to the redmine directory, and create a session storage key:
Rake config/initializers/session_store.rb
Finally, use warble to generate the war package:
Warble
In this way, you can find a war package in the redmine directory, put this package under the Tomcat webapps directory, and start the Tomcat server.
After deployment, you can access redmine through http: // localhost: 8080/redmine.