在RHEL系列的Linux上安装Redmine 5
请安装Redmine。
不保证
我没有很好地理解Ruby on Rails,所以即使你带来了工作日志,也不能保证它会运作,但如果问题出现,我无法提供支持。
请安装所需的软件包。
dnf install ruby ruby-devel sqlite sqlite-libs nodejs nodejs-libs gcc git subversion httpd mod_ssl
如果你把nano等放进去可能会更好。
本次将使用MariaDB来安装数据库。
# MariaDB 11.0 RedHatEnterpriseLinux repository list - created 2023-07-18 07:36 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# baseurl = https://rpm.mariadb.org/11.0/rhel/$releasever/$basearch
baseurl = https://mirrors.xtom.jp/mariadb/yum/11.0/rhel/$releasever/$basearch
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://mirrors.xtom.jp/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
dnf -y install MariaDB-server MariaDB-client MariaDB-devel
ユーザーを追加しておく
adduser redmine
Ruby on Railsの導入
npm install --global yarn
yarn --version
gem install rails
Redmineのチェックアウト
cd /var/www/html/
svn co https://svn.redmine.org/redmine/branches/5.0-stable redmine-5.0
在MariaDB中创建初始数据库。
mysql -uroot -p<パスワード>
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
搬到工作场所
cd redmine-5.0
データベースの設定を入れる
production:
adapter: mysql2
database: redmine
socket: /var/lib/mysql/mysql.sock
username: redmine
password: "my_password"
Railsの依存関係モジュールをインストールする
gem install bundler
bundle config set --local without 'development test'
bundle install
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
ディレクトリの作成とパーミッションの設定
chown -R apache:apache
mkdir -p tmp tmp/pdf public/plugin_assets
chown -R redmine:redmine files log tmp public/plugin_assets
chmod -R 755 files log public/plugin_assets
chmod -R 777 tmp files
安装乘客(Passenger)
curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo
dnf -y install mod_passenger || { sudo yum-config-manager --enable cr && sudo yum install -y mod_passenger ; }
安装了Passenger后,将设置添加到httpd.conf文件中。
<IfModule mod_passenger.c>
DocumentRoot /var/www/html/redmine-5.0/public
# PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
<Directory /var/www/html/redmine-5.0/public>
Allow from all
Options -MultiViews
Require all granted
</Directory>
参考网站:
Redmine官方网站
https://www.redmine.org/projects/redmine/wiki/RedmineInstall
乘客设置
https://www.phusionpassenger.com/docs/advanced_guides/install_and_upgrade/apache/install/oss/el9.html