Configure Ruby on Rails in CentOS and deploy Redmine

Source: Internet
Author: User
Tags redmine

Configure Ruby on Rails in CentOS and deploy Redmine
Git
Make sure that the dependent packages are installed:
[Plain] view plaincopy

  1. Yuminstallcurl
  2. Yuminstallcurl-devel
  3. Yuminstallzlib-devel
  4. Yuminstallopenssl-devel
  5. Yuminstallperl
  6. Yuminstallcpio
  7. Yuminstallexpat-devel
  8. Yuminstallgettext-devel

Download the git package and compile and install it:
[Plain] view plaincopy
  1. Wgethttp: // www.codemonkey.org. uk/projects/git-snapshots/GitHub/git-latest.tar.gz
  2. Tarxzvfgit-latest.tar.gz
  3. Cdgit-2011-11-30 # Your directory may not be this
  4. Autoconf
  5. ./Configure
  6. Make
  7. Sudomakeinstall

View git version:
[Plain] view plaincopy
  1. Git -- version

1. ruby
[Plain] view plaincopy
  1. Sudoyuminstallruby

2. rails
[Plain] view plaincopy
  1. Geminstallrails

3. mysql
[Plain] view plaincopy
  1. [Root @ xiaoluo ~] # Yuminstall-ymysql-servermysqlmysql-devel
  2. [Root @ xiaoluo ~] # Rpm-qimysql-server
  3. [Root @ xiaoluo ~] # Servicemysqldstart
  4. [Root @ xiaoluo ~] # Servicemysqldrestart
  5. [Root @ xiaoluo ~] # Chkconfig -- list | grepmysqld
  6. Mysqld0: Close 1: Close 2: Close 3: Close 4: Close 5: Close 6: Close
  7. [Root @ xiaoluo ~] # Chkconfigmysqldon
  8. [Root @ xiaoluo ~] # Chkconfig -- list | grepmysql
  9. Mysqld0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
  10. [Root @ xiaoluo ~] # Mysqladmin-urootpassword 'root' // Use this command to set the password of the root account to root.

4. Redmine

1) mysql

CREATE DATABASE redmine CHARACTER SET utf8;CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
2) Database connection configuration

Example for a MySQL database using ruby 1.9 (adapter must be setmysql2):

production:  adapter: mysql2  database: redmine  host: localhost  username: redmine  password: my_password

3) Dependencies installation

gem install bundler
bundle install --without development test

If ImageMagick is not installed on your system, you should skip the installation of the rmagick gem using:

bundle install --without development test rmagick
4) Session store secret generation

  • With Redmine 2.x:
rake generate_secret_token
5) Database schema objects creation

RAILS_ENV=production rake db:migrate
6) Database default data set

RAILS_ENV=production rake redmine:load_default_data
7) File system permissions

The user account running the application must have write permission on the following subdirectories:

  1. files(Storage of attachments)
  2. log(Application log fileproduction.log)
  3. tmpAndtmp/pdf(Create these ones if not present, used to generate PDF documents ents among other things)
  4. public/plugin_assets(Assets of plugins)

E. g., assuming you run the application with a redmine user account:

mkdir -p tmp tmp/pdf public/plugin_assetssudo chown -R redmine:redmine files log tmp public/plugin_assetssudo chmod -R 755 files log tmp public/plugin_assets
8) Test the installation

  • With Redmine 2.x:
ruby script/rails server webrick -e production

Use default administrator account to log in:

  • Login: admin
  • Password: admin

You can goAdministrationMenu and chooseSettingsTo modify most of the application settings.

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.