Raspbian Jessie에 Redmine3.3을 설치했습니다.
2022-10-05 last update
7 minutes reading RaspberryPi Redmine특히 목적은 없지만, 상용하고 있는 unicorn+nginx 와 다른 환경을 원했기 때문에 apache2+passenger 로 인스톨 해 보았습니다.
전제 조건
전제 조건
OS: Raspbian GNU/Linux 8 (jessie)
MW:apache2, mysql-server, ruby 설치됨.
설치 디렉토리:/usr/local/redmine3
설치 소스: SVN 리포지토리
루비 최신화, 패키지 추가
pi 사용자로 작업
sudo gem update --system
sudo gem install rdoc --no-rdoc --no-ri
sudo gem install bundler --no-rdoc --no-ri
sudo apt-get install \
ruby-dev \
libapache2-mod-passenger \
libmysqlclient-dev \
imagemagick \
libmagickcore-dev \
libmagickwand-dev \
apache2-dev \
libcurl4-openssl-dev \
libapr1-dev \
libaprutil1-dev
DB 설정
mysql -u root -p
DB 생성
create database db_redmine default character set utf8;
grant all on db_redmine.* to [email protected] identified by 'Password';
grant all on db_redmine.* to [email protected]'%' identified by 'Password';
flush privileges;
exit;
Redmine3.3 설치
sudo mkdir -p /usr/local/redmine3
sudo chown www-data:www-data /usr/local/redmine3/
sudo su - www-data -s /bin/bash
아래 www-data 사용자로 작업
cd /usr/local/
svn co http://svn.redmine.org/redmine/branches/3.3-stable/ redmine3/
mkdir -p /usr/local/redmine3/public/plugin_assets
DB 설정
/usr/local/redmine3/config/database.ymlproduction:
adapter: mysql2
database: db_redmine
host: localhost
username: user_redmine
password: Password
encoding: utf8
SMTP&쿠키 설정
/usr/local/redmine3/config/configuration.ymlproduction:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "XXX.XXX.XXX"
port: 25
domain: 'yyy.yyy.jp'
autologin_cookie_path: Redmine::Utils.relative_url_root
젬 추가
cd /usr/local/redmine3
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
bundle install --path vendor/bundle --without development test
초기 DB 생성
cd /usr/local/redmine3
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
로그 로테이트 설정
여기 루트로.
/etc/logrotate.d/redmine/usr/local/redmine3/log/production.log {
daily
rotate 5
copytruncate
compress
notifempty
missingok
}
웹 서버 설정
Passenger 빌드
pi 사용자로 돌아갑니다.
sudo gem install passenger --no-rdoc --no-ri
sudo passenger-install-apache2-module
빌드가 성공하면 이 메시지가 표시됩니다.
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
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.
빌드한 모듈의 경로를 기본값으로 바꿉니다.
/etc/apache2/mods-enabled/passenger.loadLoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
아파치 설정 변경
문서 루트 부하에 심볼릭 링크를 두는 방식으로 했습니다.
sudo ln -s /usr/local/redmine3/public /var/www/html/redmine3
빌드 결과에서 복사하여 구성 파일을 만듭니다.
/etc/apache2/sites-enabled/redmine.conf<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
</IfModule>
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerHighPerformance on
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
PassengerMaxPreloaderIdleTime 0
RackBaseURI /redmine3
시작
sudo systemctl enable apache2
sudo systemctl start apache2
http://[라즈파이의 IP]/redmine3/에 액세스하고 나중에는 평소대로 설정.
Ruby version의 부분에서 희미하게 라즈파이라고 아는 정도군요.
pi 사용자로 작업
sudo gem update --system
sudo gem install rdoc --no-rdoc --no-ri
sudo gem install bundler --no-rdoc --no-ri
sudo apt-get install \
ruby-dev \
libapache2-mod-passenger \
libmysqlclient-dev \
imagemagick \
libmagickcore-dev \
libmagickwand-dev \
apache2-dev \
libcurl4-openssl-dev \
libapr1-dev \
libaprutil1-dev
DB 설정
mysql -u root -p
DB 생성
create database db_redmine default character set utf8;
grant all on db_redmine.* to [email protected] identified by 'Password';
grant all on db_redmine.* to [email protected]'%' identified by 'Password';
flush privileges;
exit;
Redmine3.3 설치
sudo mkdir -p /usr/local/redmine3
sudo chown www-data:www-data /usr/local/redmine3/
sudo su - www-data -s /bin/bash
아래 www-data 사용자로 작업
cd /usr/local/
svn co http://svn.redmine.org/redmine/branches/3.3-stable/ redmine3/
mkdir -p /usr/local/redmine3/public/plugin_assets
DB 설정
/usr/local/redmine3/config/database.ymlproduction:
adapter: mysql2
database: db_redmine
host: localhost
username: user_redmine
password: Password
encoding: utf8
SMTP&쿠키 설정
/usr/local/redmine3/config/configuration.ymlproduction:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "XXX.XXX.XXX"
port: 25
domain: 'yyy.yyy.jp'
autologin_cookie_path: Redmine::Utils.relative_url_root
젬 추가
cd /usr/local/redmine3
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
bundle install --path vendor/bundle --without development test
초기 DB 생성
cd /usr/local/redmine3
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
로그 로테이트 설정
여기 루트로.
/etc/logrotate.d/redmine/usr/local/redmine3/log/production.log {
daily
rotate 5
copytruncate
compress
notifempty
missingok
}
웹 서버 설정
Passenger 빌드
pi 사용자로 돌아갑니다.
sudo gem install passenger --no-rdoc --no-ri
sudo passenger-install-apache2-module
빌드가 성공하면 이 메시지가 표시됩니다.
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
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.
빌드한 모듈의 경로를 기본값으로 바꿉니다.
/etc/apache2/mods-enabled/passenger.loadLoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
아파치 설정 변경
문서 루트 부하에 심볼릭 링크를 두는 방식으로 했습니다.
sudo ln -s /usr/local/redmine3/public /var/www/html/redmine3
빌드 결과에서 복사하여 구성 파일을 만듭니다.
/etc/apache2/sites-enabled/redmine.conf<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
</IfModule>
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerHighPerformance on
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
PassengerMaxPreloaderIdleTime 0
RackBaseURI /redmine3
시작
sudo systemctl enable apache2
sudo systemctl start apache2
http://[라즈파이의 IP]/redmine3/에 액세스하고 나중에는 평소대로 설정.
Ruby version의 부분에서 희미하게 라즈파이라고 아는 정도군요.
mysql -u root -p
create database db_redmine default character set utf8;
grant all on db_redmine.* to [email protected] identified by 'Password';
grant all on db_redmine.* to [email protected]'%' identified by 'Password';
flush privileges;
exit;
sudo mkdir -p /usr/local/redmine3
sudo chown www-data:www-data /usr/local/redmine3/
sudo su - www-data -s /bin/bash
아래 www-data 사용자로 작업
cd /usr/local/
svn co http://svn.redmine.org/redmine/branches/3.3-stable/ redmine3/
mkdir -p /usr/local/redmine3/public/plugin_assets
DB 설정
/usr/local/redmine3/config/database.yml
production:
adapter: mysql2
database: db_redmine
host: localhost
username: user_redmine
password: Password
encoding: utf8
SMTP&쿠키 설정
/usr/local/redmine3/config/configuration.yml
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "XXX.XXX.XXX"
port: 25
domain: 'yyy.yyy.jp'
autologin_cookie_path: Redmine::Utils.relative_url_root
젬 추가
cd /usr/local/redmine3
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
bundle install --path vendor/bundle --without development test
초기 DB 생성
cd /usr/local/redmine3
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
로그 로테이트 설정
여기 루트로.
/etc/logrotate.d/redmine
/usr/local/redmine3/log/production.log {
daily
rotate 5
copytruncate
compress
notifempty
missingok
}
웹 서버 설정
Passenger 빌드
pi 사용자로 돌아갑니다.
sudo gem install passenger --no-rdoc --no-ri
sudo passenger-install-apache2-module
빌드가 성공하면 이 메시지가 표시됩니다.
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
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.
빌드한 모듈의 경로를 기본값으로 바꿉니다.
/etc/apache2/mods-enabled/passenger.loadLoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
아파치 설정 변경
문서 루트 부하에 심볼릭 링크를 두는 방식으로 했습니다.
sudo ln -s /usr/local/redmine3/public /var/www/html/redmine3
빌드 결과에서 복사하여 구성 파일을 만듭니다.
/etc/apache2/sites-enabled/redmine.conf<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
</IfModule>
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerHighPerformance on
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
PassengerMaxPreloaderIdleTime 0
RackBaseURI /redmine3
시작
sudo systemctl enable apache2
sudo systemctl start apache2
http://[라즈파이의 IP]/redmine3/에 액세스하고 나중에는 평소대로 설정.
Ruby version의 부분에서 희미하게 라즈파이라고 아는 정도군요.
sudo gem install passenger --no-rdoc --no-ri
sudo passenger-install-apache2-module
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
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.
LoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
sudo ln -s /usr/local/redmine3/public /var/www/html/redmine3
<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/bin/ruby2.1
</IfModule>
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerHighPerformance on
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
PassengerMaxPreloaderIdleTime 0
RackBaseURI /redmine3
sudo systemctl enable apache2
sudo systemctl start apache2
http://[라즈파이의 IP]/redmine3/에 액세스하고 나중에는 평소대로 설정.
Ruby version의 부분에서 희미하게 라즈파이라고 아는 정도군요.
