Anasayfa » Centos 6.5 Final Redmine 2.4.2 Kurulumu

Makaleyi Paylaş

Linux Unix

Centos 6.5 Final Redmine 2.4.2 Kurulumu

Redmine proje yönetimi, doküman yönetimi, iş akışı yönetimini sağlamak için kullanılabilecek ücretsiz ve açık kaynak kodlu bir uygulamadır.

Centos 6.5 Final işletim sistemine kurulumu için aşağıdaki adımlar takip edilmelidir.

 

clip_image002

İşletim sistemi güncellenmesi için;

# yum update -y

 

Redmine uygulamasının kullanacağı veritabanı ve php için kurulacak mysql ve php mysql desteği için;

Sponsor

# yum install mysql-server mysql php-mysql -y

 

 

Mysql veritabanının işletim sisteminin 2,3 ve 5. çalışma seviyelerinde servis olarak otomatik başlaması için;

# chkconfig –levels 235 mysqld on ; service mysqld start

 

Redmine uygulamasının kurulumunda ve kullanımında ihtiyaç duyulacak paketlerin kurulumu için;

# yum install make gcc gcc-c++ zlib-devel ruby-devel rubygems ruby-libs apr-devel apr-util-devel httpd-devel mysql-devel mysql-server automake autoconf ImageMagick ImageMagick-devel curl-devel -y

 

Redmine kurulum dosyasının indirilmesi için;

# cd /var/www

# wget http://www.redmine.org/releases/redmine-2.4.2.tar.gz

# tar -vxzf redmine-2.4.2.tar.gz

# mv redmine-2.4.2 redmine

 

Ruby modüllerinin kurulması için;

# gem install bundle

Successfully installed bundler-1.3.5

Successfully installed bundle-0.0.1

2 gems installed

Installing ri documentation for bundler-1.3.5…

Installing ri documentation for bundle-0.0.1…

File not found: lib

 

# bundle install –without postgresql sqlite test development

 

Please configure your config/database.yml first

Fetching gem metadata from https://rubygems.org/………

Fetching gem metadata from https://rubygems.org/..

Resolving dependencies…

Installing rake (10.1.1)

Installing i18n (0.6.9)

Installing multi_json (1.8.2)

Installing activesupport (3.2.16)

Installing builder (3.0.0)

Installing activemodel (3.2.16)

Installing erubis (2.7.0)

Installing journey (1.0.4)

Installing rack (1.4.5)

Installing rack-cache (1.2)

Installing rack-test (0.6.2)

Installing hike (1.2.3)

Installing tilt (1.4.1)

Installing sprockets (2.2.2)

Installing actionpack (3.2.16)

Installing mime-types (1.25.1)

Installing polyglot (0.3.3)

Installing treetop (1.4.15)

Installing mail (2.5.4)

Installing actionmailer (3.2.16)

Installing arel (3.0.3)

Installing tzinfo (0.3.38)

Installing activerecord (3.2.16)

Installing activeresource (3.2.16)

Using bundler (1.3.5)

Installing coderay (1.1.0)

Installing fastercsv (1.5.5)

Installing rack-ssl (1.3.3)

Installing json (1.8.1)

Installing rdoc (3.12.2)

Installing thor (0.18.1)

Installing railties (3.2.16)

Installing jquery-rails (2.0.3)

Installing net-ldap (0.3.1)

Installing ruby-openid (2.3.0)

Installing rack-openid (1.4.1)

Installing rails (3.2.16)

Installing rmagick (2.13.2)

Your bundle is complete!

Gems in the groups postgresql, sqlite, test and development were not installed.

Use `bundle show [gemname]` to see where a bundled gem is installed.

Post-install message from rdoc:

Depending on your version of ruby, you may need to install ruby rdoc/ri data:

 

<= 1.8.6 : unsupported

= 1.8.7 : gem install rdoc-data; rdoc-data –install

= 1.9.1 : gem install rdoc-data; rdoc-data –install

>= 1.9.2 : nothing to do! Yay!

 

Redmine için veritabanı oluşturulması;

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

 

In order to log into MySQL to secure it, we’ll need the current

password for the root user.  If you’ve just installed MySQL, and

you haven’t set the root password yet, the password will be blank,

so you should just press enter here.

 

Enter current password for root (enter for none): [ENTER]

OK, successfully used password, moving on…

 

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

 

Set root password? [Y/n] Y

New password: [123456]

Re-enter new password: [123456]

Password updated successfully!

Reloading privilege tables..

… Success!

 

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

 

Remove anonymous users? [Y/n] n

… skipping.

 

Normally, root should only be allowed to connect from ‘localhost’.  This

ensures that someone cannot guess at the root password from the network.

 

Disallow root login remotely? [Y/n] n

… skipping.

 

By default, MySQL comes with a database named ‘test’ that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

 

Remove test database and access to it? [Y/n] Y

– Dropping test database…

… Success!

– Removing privileges on test database…

… Success!

 

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

 

Reload privilege tables now? [Y/n] Y

… Success!

 

Cleaning up…

 

All done!  If you’ve completed all of the above steps, your MySQL

installation should now be secure.

 

Thanks for using MySQL!

 

# mysql -u root -p

Password: 123456

mysql> create database redmine character set utf8;

Query OK, 1 row affected (0.00 sec)

 

mysql> grant all privileges on redmine.* to ‘redmine’@’localhost’ identified by ‘123456’;

Query OK, 0 rows affected (0.00 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

 

mysql> quit

Bye

 

 

Redmine uygulamasının konfigürasyon dosyasının ayarlanması için;

# cd /var/www/redmine/config

 

# cp database.yml.example database.yml

 

# vi database.yml

# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.

# Line indentation must be 2 spaces (no tabs).

 

production:

  adapter: mysql2

  database: redmine

  host: localhost

  username: root

  password: “123456”

  encoding: utf8

 

# bundle install –no-deployment

 

Fetching gem metadata from https://rubygems.org/………

Fetching gem metadata from https://rubygems.org/..

Resolving dependencies…

Using rake (10.1.1)

Using i18n (0.6.9)

Using multi_json (1.8.2)

Using activesupport (3.2.16)

Using builder (3.0.0)

Using activemodel (3.2.16)

Using erubis (2.7.0)

Using journey (1.0.4)

Using rack (1.4.5)

Using rack-cache (1.2)

Using rack-test (0.6.2)

Using hike (1.2.3)

Using tilt (1.4.1)

Using sprockets (2.2.2)

Using actionpack (3.2.16)

Using mime-types (1.25.1)

Using polyglot (0.3.3)

Using treetop (1.4.15)

Using mail (2.5.4)

Using actionmailer (3.2.16)

Using arel (3.0.3)

Using tzinfo (0.3.38)

Using activerecord (3.2.16)

Using activeresource (3.2.16)

Using bundler (1.3.5)

Using coderay (1.1.0)

Using fastercsv (1.5.5)

Using rack-ssl (1.3.3)

Using json (1.8.1)

Using rdoc (3.12.2)

Using thor (0.18.1)

Using railties (3.2.16)

Using jquery-rails (2.0.3)

Installing mysql2 (0.3.14)

Using net-ldap (0.3.1)

Using ruby-openid (2.3.0)

Using rack-openid (1.4.1)

Using rails (3.2.16)

Using rmagick (2.13.2)

Your bundle is complete!

Gems in the groups postgresql, sqlite, test and development were not installed.

Use `bundle show [gemname]` to see where a bundled gem is installed.

 

 

# rake generate_session_store

Note: The rake task generate_session_store has been deprecated, please use the replacement version generate_secret_token

 

# bundle update rake

 

# rake db:migrate_plugins  RAILS_ENV=production

Note: The rake task db:migrate_plugins has been deprecated, please use the replacement version redmine:plugins:migrate

 

# rake db:migrate RAILS_ENV=”production”

 

———–

[kısaltıldı]

==  AddQueriesOptions: migrating ==============================================

— add_column(:queries, :options, :text)

   -> 0.2173s

==  AddQueriesOptions: migrated (0.2173s) =====================================

 

==  AddUsersMustChangePasswd: migrating =======================================

— add_column(:users, :must_change_passwd, :boolean, {:null=>false, :default=>false})

   -> 0.2984s

==  AddUsersMustChangePasswd: migrated (0.2985s) ==============================

 

==  RemoveEolsFromAttachmentsFilename: migrating ==============================

==  RemoveEolsFromAttachmentsFilename: migrated (0.0023s) =====================

 

==  SupportForMultipleCommitKeywords: migrating ===============================

==  SupportForMultipleCommitKeywords: migrated (0.0028s) ======================

 

==  AddRepositoriesCreatedOn: migrating =======================================

— add_column(:repositories, :created_on, :timestamp)

   -> 0.2137s

==  AddRepositoriesCreatedOn: migrated (0.2137s) ==============================

———————-

 

 

# rake redmine:load_default_data RAILS_ENV=”production”

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]

[ENTER]

====================================

Default configuration data loaded.

 

 

Redmine standalone çalıştırıp test edilmesi için;

# ruby ./script/rails server webrick -e production

 

=> Booting WEBrick

=> Rails 3.2.16 application starting in production on http://0.0.0.0:3000

=> Call with -d to detach

=> Ctrl-C to shutdown server

[2013-12-26 14:54:12] INFO  WEBrick 1.3.1

[2013-12-26 14:54:12] INFO  ruby 1.8.7 (2011-06-30) [x86_64-linux]

[2013-12-26 14:54:12] INFO  WEBrick::HTTPServer#start: pid=31401 port=3000

Started GET “/” for 127.0.0.1 at Thu Dec 26 14:54:40 +0200 2013

Processing by WelcomeController#index as HTML

  Current user: anonymous

  Rendered welcome/index.html.erb within layouts/base (81.4ms)

Completed 200 OK in 301.1ms (Views: 103.2ms | ActiveRecord: 60.0ms)

 

 

Iptables firewall dan izin vermek için aşağıdaki kurallar girilebilir.

 

-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3000 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

 

# service iptables restart

 

Passenger installation aşağıdaki adımlar uygualanır.

# cd /var/www/redmine

 

# gem install passenger

 

Building native extensions.  This could take a while…

Successfully installed daemon_controller-1.1.8

Successfully installed passenger-4.0.29

2 gems installed

Installing ri documentation for daemon_controller-1.1.8…

Installing ri documentation for passenger-4.0.29…

Installing RDoc documentation for daemon_controller-1.1.8…

Installing RDoc documentation for passenger-4.0.29…

 

 

# passenger-install-apache2-module

Welcome to the Phusion Passenger Apache 2 module installer, v4.0.29.

 

This installer will guide you through the entire installation process. It

shouldn’t take more than 3 minutes in total.

 

Here’s what you can expect from the installation process:

 

1. The Apache 2 module will be installed for you.

2. You’ll learn how to configure Apache.

3. You’ll learn how to deploy a Ruby on Rails application.

 

Don’t worry if anything goes wrong. This installer will advise you on how to

solve any problems.

 

Press Enter to continue, or Ctrl-C to abort.

[ENTER]

.

.

 

The Apache 2 module was successfully installed.

 

Please edit your Apache configuration file, and add these lines:

 

   LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.29/buildout/apache2/mod_passenger.so

   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.29

   PassengerDefaultRuby /usr/bin/ruby

 

After you restart Apache, you are ready to deploy any number of Ruby on Rails

applications on Apache, without any further Ruby on Rails-specific

configuration!

 

Press ENTER to continue.

[ENTER]

 

——————————————–

Deploying a Ruby on Rails application: an example

 

Suppose you have a Rails application in /somewhere. Add a virtual host to your

Apache configuration file and set its DocumentRoot to /somewhere/public:

 

   <VirtualHost *:80>

      ServerName www.yourhost.com

      # !!! Be sure to point DocumentRoot to ‘public’!

      DocumentRoot /somewhere/public

      <Directory /somewhere/public>

         # This relaxes Apache security settings.

         AllowOverride all

         # MultiViews must be turned off.

         Options -MultiViews

      </Directory>

   </VirtualHost>

 

And that’s it! You may also want to check the Users Guide for security and

optimization tips, troubleshooting and other useful information:

 

  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.29/doc/Users guide Apache.html

  http://www.modrails.com/documentation/Users%20guide%20Apache.html

 

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) 🙂

https://www.phusionpassenger.com

 

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.

# cd /etc/httpd

# mv conf.d available

# mkdir conf.d

# cd conf.d

# vi redmine.conf

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.29/buildout/apache2/mod_passenger.so

PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.29

PassengerDefaultRuby /usr/bin/ruby

 

 

<VirtualHost *:80>

      ServerName redmine.domain.com

      # !!! Be sure to point DocumentRoot to ‘public’!

      DocumentRoot /somewhere/public

      <Directory /somewhere/public>

         # This relaxes Apache security settings.

         AllowOverride all

         # MultiViews must be turned off.

         Options -MultiViews

      </Directory>

                

                  ErrorLog “|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-error.%Y-%m-%d.log 86400”

      CustomLog “|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-access.%Y-%m-%d.log 86400” “%h %l %u %t %D \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\””

                

</VirtualHost>

:wq!

 

Apache web servisi konfigürasyon dosyasındaki “NameVirtualHost” özelliği aktif edilir.

# vi /etc/httpd/conf/httpd.conf

# Use name-based virtual hosting.

#

 

NameVirtualHost *:80

 

#

# NOTE: NameVirtualHost cannot be used without a port specifier

# (e.g. :80) if mod_ssl is being used, due to the nature of the

# SSL protocol.

 

:wq!

# chown -R apache:root /var/www/redmine

# service httpd configtest

 

httpd: apr_sockaddr_info_get() failed for savtag

httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

[Thu Dec 26 15:10:33 2013] [warn] NameVirtualHost *:80 has no VirtualHosts

Syntax OK

 

 

Selinux kapatmak için;

# vi /etc/selinux/config

 

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing – SELinux security policy is enforced.

#     permissive – SELinux prints warnings instead of enforcing.

#     disabled – No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

#     targeted – Targeted processes are protected,

#     mls – Multi Level Security protection.

SELINUXTYPE=targeted

 

:wq!

# service iptables stop

# chkconfig –level 345 mysqld on

# chkconfig –level 345 httpd on

# cd /var/www/redmine

# /etc/init.d/httpd restart

 

Passenger servisinin redmine uygulamasını çalıştırıp hizmete sunması için;

# passenger start -e production

 

–> Downloading Phusion Passenger support binaries for your platform

     Checking whether the downloaded Watchdog binary is usable

     Checking whether the downloaded HelperAgent binary is usable

     Checking whether the downloaded LoggingAgent binary is usable

     All good

–> Downloading web helper for your platform

     Checking whether the downloaded binary is usable

     All good

=============== Phusion Passenger Standalone web server started ===============

PID file: /var/www/redmine/tmp/pids/passenger.3000.pid

Log file: /var/www/redmine/log/passenger.3000.log

Environment: production

Accessible via: http://0.0.0.0:3000/

 

You can stop Phusion Passenger Standalone by pressing Ctrl-C.

Problems? Check http://www.modrails.com/documentation/Users%20guide%20Standalone.html#troubleshooting

===============================================================================

App 6194 stdout:

App 6194 stderr: *** Phusion Passenger: no passenger_native_support.so found for the current Ruby interpreter. Downloading precompiled binary from the Phusion server (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)…

App 6194 stderr:

App 6194 stderr: cp /usr/lib/ruby/gems/1.8/gems/passenger-4.0.29/download_cache/rubyext-ruby-1.8.7-x86_64-linux.tar.gz /tmp/passenger-native-support-4ebvru/rubyext-ruby-1.8.7-x86_64-linux.tar.gz

App 6194 stderr: # tar xzf rubyext-ruby-1.8.7-x86_64-linux.tar.gz

App 6194 stderr: # rm -f rubyext-ruby-1.8.7-x86_64-linux.tar.gz

App 6194 stderr: Checking whether downloaded binary is usable…

App 6194 stderr:

App 6194 stderr: # /usr/bin/ruby -I. test.rb

App 6194 stderr:

App 6194 stderr: Binary is usable.

App 6194 stderr:

App 6194 stderr: # mkdir -p /tmp/passenger-standalone.1wl4zan/locations.ini/buildout/ruby/ruby-1.8.7-x86_64-linux

App 6194 stderr: Not a valid directory. Trying a different one…

App 6194 stderr:

App 6194 stderr: ——————————-

App 6194 stderr: # mkdir -p /root/.passenger/native_support/4.0.29/ruby-1.8.7-x86_64-linux

App 6194 stderr: # cd /root/.passenger/native_support/4.0.29/ruby-1.8.7-x86_64-linux

App 6194 stderr:

App 6194 stderr: # Installing passenger_native_support.so

Connecting to database specified by database.yml

Creating scope :system. Overwriting existing method Enumeration.system.

Creating scope :sorted. Overwriting existing method Group.sorted.

Creating scope :sorted. Overwriting existing method User.sorted.

[ 2013-12-26 15:18:46.0777 6163/7f8af0ed6700 Pool2/SmartSpawner.h:301 ]: Preloader for /var/www/redmine started on PID 6194, listening on unix:/tmp/passenger.1.0.6157/generation-0/backends/preloader.6194

Started GET “/” for 127.0.0.1 at Thu Dec 26 15:18:46 +0200 2013

Processing by WelcomeController#index as HTML

  Current user: anonymous

  Rendered welcome/index.html.erb within layouts/base (18.3ms)

Completed 200 OK in 246.6ms (Views: 36.9ms | ActiveRecord: 8.7ms)

 

 

http://ip:3000

Öntanımlı olarak 3000 portundan çalışan redmine uygulamasının 80 portundan çalışması istenildiğinde;

# service httpd stop

# chkconfig httpd off

# ruby /var/www/redmine/script/rails server -p 80 -e production

 

Redmine uygulama sunucusu yeniden başladığında otomatik olarak başlatmak için;

# vi /etc/rc.local

# You can put your own initialization stuff in here if you don’t

# want to do the full Sys V style init stuff.

 

ruby /var/www/redmine/script/rails server -p 80 -e production

:wq!

Kaynak:

http://mrtn.me/blog/2012/07/06/installing-redmine-on-centos-6-dot-2-wiht-mysql-and-apache/

http://www.redmine.org/boards/1/topics/17692

Makaleyi Paylaş

Cevap bırakın