Install Ruby & Package
# cd /var/www/redmine/public
# cp ./dispatch.fcgi.example ./dispatch.fcgi
# a2enmod passenger
# sudo apt-get install ruby rake rubygems
# sudo apt-get install libmysql-ruby
# sudo apt-get install libopenssl-ruby1.8
# sudo apt-get install build-essential
# sudo apt-get install apache2-prefork-dev
# sudo apt-get install libapr1-dev
# sudo apt-get install libaprutil-dev
# sudo apt-get install libmysql-ruby
# sudo apt-get install libopenssl-ruby1.8
# sudo apt-get install build-essential
# sudo apt-get install apache2-prefork-dev
# sudo apt-get install libapr1-dev
# sudo apt-get install libaprutil-dev
Install Rails
# gem install rails -v=2.3.5
Install Redmin
# wget http://rubyforge.org/frs/download.php/71723/redmine-1.0.0.tar.gz
# tar xzfv redmine-1.0.0.tar.gz -C /var/www
# cd /var/www
# ln -s ./redmine-1.0.0 redmine
Create Database
# mysql -u root -p
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'password';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
mysql> flush privileges;
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'password';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
mysql> flush privileges;
Configuration Database
# cd /var/www/redmine/config
# cp database.yml.example database.yml
# vi database.yml
----------------------------------
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: redmine
----------------------------------
Start Redmine
# cd /var/www/redmine
# rake generate_session_store
# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_data
# mkdir -p tmp public/plugin_assets <= 보통 디렉토리가 있다.
# adduser redmine
# passwd redmine
# sudo chown -R redmine:redmine files log tmp public/plugin_assets
# sudo chmod -R 755 files log tmp public/plugin_assets
# ruby script/server webrick -e production
# rake generate_session_store
# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_data
# mkdir -p tmp public/plugin_assets <= 보통 디렉토리가 있다.
# adduser redmine
# passwd redmine
# sudo chown -R redmine:redmine files log tmp public/plugin_assets
# sudo chmod -R 755 files log tmp public/plugin_assets
# ruby script/server webrick -e production
3000번 포트로는 redmine 접속이 가능하지만, Passenger를 이용해서 아파치(80)포트와 연동하자.
Install & Configure Passenger
# sudo apt-get install libapache2-mod-passenger libapache2-mod-fastcgi
# vi /etc/apache2/mods-available/passenger.conf
-----------------------------------------------------------
# vi /etc/apache2/mods-available/passenger.conf
-----------------------------------------------------------
<IfModule mod_passenger.c>
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
PassengerRuby /usr/bin/ruby
PassengerDefaultUser redmine <= 추가
</IfModule>
</IfModule>
-----------------------------------------------------------
# vi /etc/apache2/sites-enabled/000-default
-----------------------------------------------------------
-----------------------------------------------------------
DocumentRoot /var/www <= 확인
# 추가 #
# 추가 #
<Directory /var/www/redmine>
RailsBaseURI /redmine/public
PassengerResolveSymlinksInDocumentRoot on
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
-----------------------------------------------------------
# vi /var/www/redmine/public/.htaccess
-----------------------------------------------------------
-----------------------------------------------------------
# 확인 #
RewriteEngine On
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
-----------------------------------------------------------
# cd /var/www/redmine/public
# cp ./dispatch.fcgi.example ./dispatch.fcgi
# a2enmod passenger
# a2enmod fastcgi
# apache2ctl restart
http://your.ip.address:3000
http://your.ip.address/redmine/public
위의 주소로 접속이 가능하다.
Apply VirtualHost
# vi /etc/apache2/sites-enabled/000-default
------------------------주석처리한다.--------------------------------
#<Directory /var/www/redmine>
# RailsBaseURI /redmine/public
# PassengerResolveSymlinksInDocumentRoot on
# Options Indexes ExecCGI FollowSymLinks
# Order allow,deny
# Allow from all
# AllowOverride all
#</Directory>
-------------------------------------------------------------------
# vi /etc/apache2/sites-available/redmine.your_domain.com
-------------------------------------------------------------------
-------------------------------------------------------------------
<VirtualHost *:80>
ServerName redmine.your_domain.com
ServerAlias redmine
DocumentRoot /var/www/redmine/public
RailsBaseURI /
RailsEnv production
PassengerMaxPoolSize 4
<Directory /var/www/redmine/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
LogLevel info
ErrorLog /var/log/apache2/redmine-error.log
CustomLog /var/log/apache2/redmine-access.log combined
</VirtualHost>
-------------------------------------------------------------------
# sudo a2ensite redmine.your_domain.com
# /etc/init.d/apache2 reload
http://your.ip.address:3000
http://redmine.your_domain.com/
Reference
Application error
Rails application failed to start properly
/var/www/redmine/public/.htaccess file을 삭제한다.
# cd /var/www/redmine/public
# cd /var/www/redmine/public
# mv .htaccess .htaccess.orig
'Server-Side > Linux' 카테고리의 다른 글
[CentOS] how to install mongodb in 64bit centos (0) | 2011.06.06 |
---|---|
[SVN] how to create repository on ubuntu 10.10 (0) | 2011.01.12 |
[SVN] how to install subversion on CentOS5.X 64bit (0) | 2011.01.04 |
[ntp] Network Time Protocol 사용하기 (0) | 2010.12.21 |
[ntp] no server suitable for synchronization found (0) | 2010.12.21 |