如何在 AlmaLinux 8 上安装 Redmine
admin
2023-08-02 05:04:03
0

Redmine 是一个跨平台和跨数据库的灵活项目管理 Web 应用程序。Redmine 包括对多个项目、wiki、问题跟踪系统、论坛、日历、电子邮件通知等的支持。Redmine-logoRedmine-logo

在 AlmaLinux 8 上安装 Redmine

步骤 1. 首先,让我们先确保您的系统是最新的。

sudo dnf update
sudo dnf install epel-release
sudo dnf config-manager --set-enabled powertools

步骤 2. 安装所需的依赖项。

现在运行以下命令将依赖项安装到您的系统:

sudo dnf install ruby ruby-devel rpm-build wget libxml2-devel vim make openssl-devel automake libtool ImageMagick ImageMagick-devel MariaDB-devel gcc httpd-devel libcurl-devel gcc-c++

步骤 3. 创建新的系统用户。

使用将运行 Redmine的主目录创建一个新用户和组:/opt/redmine

useradd -r -m -d /opt/redmine redmine

步骤 4. 在 AlmaLinux 8 上安装 Apache。

运行以下命令来安装 Apache 网络服务器:

sudo dnf install httpd httpd-tools

在您的系统上安装 Apache 服务后,启动所有必需的服务:

sudo systemctl enable httpd
sudo systemctl start httpd
sudo systemctl status httpd

接下来,由于我们将使用 Apache 作为我们的 HTTP 服务器,将 Apache 添加到 Redmine 组:

usermod -aG redmine apache

步骤 5. 在 AlmaLinux 8 上安装 MariaDB。

MariaDB 是一种流行的数据库服务器。安装很简单,只需要几个步骤,如图所示:

sudo dnf install mariadb-server mariadb

安装完成后,开始使用以下命令使其在系统启动时启动:

sudo systemctl restart mariadb
sudo systemctl status mariadb
sudo systemctl enable mariadb

默认情况下,MariaDB 未加固。您可以使用mysql_secure_installation脚本保护 MariaDB 。您应该仔细阅读以下每个步骤,这些步骤将设置 root 密码、删除匿名用户、禁止远程 root 登录以及删除测试数据库和访问安全 MariaDB 的权限:

mysql_secure_installation

像这样配置它:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

要登录 MariaDB,请使用以下命令(请注意,它与您用于登录 MariaDB 数据库的命令相同):

mysql -u root -p

在 MariaDB shell 执行以下命令,为 Redmine 软件创建数据库和用户。

MariaDB [(none)]> create database redminedb;
MariaDB [(none)]> grant all on redminedb.* to redmineadmin@localhost identified by \'your-strong-password\';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit

步骤 6. 在 AlmaLinux 8 上安装 Redmine。

现在我们从官方页面下载最新版本的Redmine:

wget https://www.redmine.org/releases/redmine-4.2.2.tar.gz -P /tmp

之后,将 Redmine tarball 解压缩到 Redmine 用户的主目录:

sudo -u redmine tar xzf /tmp/redmine-4.2.2.tar.gz -C /opt/redmine/ --strip-components=1

步骤 7. 配置 Redmine 数据库。

首先切换到Redmine的用户账号:

su - redmine

重命名示例 Redmine 配置:

cp config/configuration.yml{.example,}

重命名 public 文件夹下的示例调度 CGI 配置文件:

cp public/dispatch.fcgi{.example,}

将示例重命名为数据库配置文件:

cp config/database.yml{.example,}

接下来,打开数据库配置文件:

nano config/database.yml

添加以下文件:

...
production:
  adapter: mysql2
  database: redminedb
  host: localhost
  username: redmineadmin
  password: \"your-strong-password\"
  # Use \"utf8\" instead of \"utfmb4\" for MySQL prior to 5.7.7
  encoding: utf8mb4
...

步骤 7. 安装 Ruby 依赖项。

切换到 Redmine 用户并安装 Ruby 依赖项:

su - redmine

接下来,安装用于管理 gem 依赖项的 Bundler:

gem install bundler
bundle config set --local without \'development test\'
bundle install

步骤 8. 生成密钥并迁移数据库。

为了防止对存储会话数据的 cookie 进行调整,您需要生成一个 Rails 用来对它们进行编码的随机密钥:

bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate

数据库迁移完成后,将默认配置数据插入数据库:

RAILS_ENV=production REDMINE_LANG=en bundle exec rake redmine:load_default_data

然后,配置文件系统权限:

for i in tmp tmp/pdf public/plugin_assets; do [ -d $i ] || mkdir -p $i; done
chown -R redmine:redmine files log tmp public/plugin_assets
chmod -R 755 /opt/redmine/

步骤 9. 配置防火墙。

使用以下命令打开必要的端口:

sudo firewall-cmd --add-port=3000/tcp --permanent
sudo firewall-cmd --reload

步骤 10. 为 Redmine 配置 Apache。

切换到上面创建的 Redmine 用户以安装 Phusion Passenger Apache 模块:

su - redmine
gem install passenger --no-rdoc --no-ri

然后,使用以下命令安装Passenger Apache 模块:

passenger-install-apache2-module

接下来,使用 nano 文本编辑器创建一个 Apache 模块配置文件:

nano/etc/httpd/conf.modules.d/00-passenger.conf

添加以下文件:

LoadModule passenger_module /opt/redmin/.gem/ruby/gems/passenger-6.0.10/buildout/apache2/mod_passenger.so
   
     PassengerRoot /opt/redmine/.gem/ruby/gems/passenger-6.0.10
     PassengerDefaultRuby /usr/bin/ruby
   

然后,创建一个 Apache 配置文件:

nano/etc/httpd/conf.d/redmine.conf

添加以下文件:

Listen 3000

  PassengerRoot /opt/redmin/.gem/ruby/gems/passenger-6.0.10
  PassengerDefaultRuby /usr/bin/ruby


    ServerName redmine.idroot.us
    DocumentRoot \"/opt/redmine/public\" 

    CustomLog logs/redmine_access.log combined
    ErrorLog logs/redmine_error_log
    LogLevel warn

    
        Options Indexes ExecCGI FollowSymLinks
        Require all granted
        AllowOverride all
    

通过执行以下命令验证 Apache 配置:

httpd -t
sudo systemctl restart httpd

最后,在您的 Linux 服务器上禁用 SELinux:

setenforce 0
sed -i \'s/=enforcing/=disabled/\' /etc/selinux/config

步骤 11. 访问 Redmine Web 界面。

成功安装后,现在通过浏览器使用地址访问 Redmine Web 界面。http://redmine.idroot.us:3000

redmine-web-interface-loginredmine-web-interface-login

Redmine 的默认登录凭据是:

  • 用户名:管理员
  • 密码:管理员

感谢您使用本教程在您的 AlmaLinux 8 系统上安装 Redmine 开源项目管理应用程序。如需其他帮助或有用信息,我们建议您查看Redmine 官方网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
在 Windows 11 中打... 什么是链路状态电源管理? 您可以在系统控制面板的电源选项中看到链接状态电源管理。它是 PCI Exp...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
iPhone 屏幕上有亮绿色斑... iPhone 是市场上最稳定的智能手机之一,这主要归功于专为它们设计的 iOS 操作系统。然而,他们...
balenaEtcher烧录后... balenaEtcher烧录后u盘或者内存卡无法识别不能使用的解决方法想要恢复原来的方法,使用win...
farols1.1.501.0... faro ls 1.1.501.0(64bit)可以卸载,是一款无需连接外部PC机或笔记本计算机即可...