redmine install on ubuntu 22.04
centos 7, 8 버전에서 설치가 잘 안되서 ubuntu 22.04 에서 설치를 진행했다.
기본패키지 설치
# apt-get update
# apt install -y build-essential libmysqlclient-dev libpq-dev libmagickwand-dev imagemagick libsqlite3-dev
mysql 설치 및 설정
# apt install -y mysql-server mysql-client
# systemctl start mysql
# mysql_secure_installation
mysql db생성
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
FLUSH PRIVILEGES;
EXIT;
redmine 다운로드 및 설치
# cd /opt
# wget https://www.redmine.org/releases/redmine-5.1.3.tar.gz
# tar -xvf redmine-5.1.3.tar.gz
# mv redmine-5.1.3 redmine
# cd /opt/redmine/config
# cp database.yml.example database.yml
# vi database.yml
위와 같이 수정
gem 설치
# gem install puma
# vi /opt/redmine/config/puma.rb
파일생성해서 아래 내용 입력
#!/usr/bin/env puma
directory '/opt/redmine'
rackup "/opt/redmine/config.ru"
environment 'production'
pidfile "/opt/redmine/tmp/pids/puma.pid"
state_path "/opt/redmine/tmp/pids/puma.state"
stdout_redirect '/opt/redmine/log/puma.stdout.log', '/opt/redmine/log/puma.stderr.log', true
threads 0,16
bind 'tcp://0.0.0.0:3000'
workers 0
preload_app!
on_worker_boot do
ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
end
# cd /opt/redmine
# apt install -y ruby-bundler
# bundle install --without development test
# bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production REDMINE_LANG=ko bundle exec rake redmine:load_default_data
# mkdir -p /opt/redmine/tmp/pids
# chown -R redmine:redmine /opt/redmine/tmp
# vi /etc/systemd/system/redmine.service
[Unit]
Description=Redmine
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/redmine ExecStart=/usr/local/bin/puma -C /opt/redmine/config/puma.rb
[Install]
WantedBy=multi-user.target
위 내용 추가
# systemctl start redmine
# systemctl enable redmine
nginx 설치 및 설정
# apt install -y nginx
# vi /etc/nginx/sites-available/redmine
server {
listen 80;
server_name your_domain_or_IP;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# ln -s /etc/nginx/sites-available/redmine /etc/nginx/sites-enabled/redmine
# systemctl restart nginx
만약에 443 도 적용하려면 위와 같이 추가 하면 된다.
# firefox http://localhost
하면 5.1.3 버전으로 설치가 완료가 된다.
nginx 에러 로그는
/var/log/nginx
redmine 에러 로그는
/opt/redmine/log
위치에 있다.
https://algo79.tistory.com/1831
bitnami redmine 설치 방법