如何在Ubuntu 20.04 Linux上安装Redmine

时间:2020-02-23 14:39:18  来源:igfitidea点击:

Redmine是一个免费的和开源项目管理工具,具有基于Web的管理仪表板,用户可以管理项目。
Redmine是在Rails框架上制造的。
通过Redmine,我们可以跟踪项目的时间,文档和编写项目的Wiki页面。
它的RBAC确保有一个结构化的访问结构。

Redmine Project Management Tool的功能包括:多个项目支持的基于角色的Access ControlClexible问题跟踪SystemGantt图表和日历信息和电子邮件通知程序Wikiper Project&Email Notifications Project WatchingCustom TrackingCustom字段用于问题,时间条目,项目和用户专业程序(SVN,CVS ,git,mercurial和bazaar)通过电子邮件发出创建,通过电子邮件提供LDAP身份验证SupportUser自我注册支持方法支持多个数据库支持

在Ubuntu 20.04上安装Redmine后,我们可以根据需要添加此功能。

第1步:连接到服务器并更新

SSH到服务器:

$ssh Hyman@theitroad

开始更新它以用于在服务器中更新的最新包。

sudo apt update
sudo apt upgrade
sudo reboot

第2步:安装MariaDB数据库服务器

在Ubuntu 20.04上更新,安装和配置MariaDB数据库服务器后| Ubuntu 18.04.

sudo apt update
sudo apt install mariadb-server

确认它正在工作:

$sudo mysql -u root
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 57
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>

第3步:为Redmine创建数据库

使用Ubuntu上安装的数据库服务器,让我们为Redmine项目管理平台创建数据库和用户。

$sudo mysql -u root -p
CREATE DATABASE redmine CHARACTER SET utf8mb4;
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'Hyman@theitroad';
FLUSH PRIVILEGES;
EXIT;

确认Redmine数据库用户可以使用已配置的密码登录MySQL shell。

$mysql -u redmine -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 59
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| redmine            |
+--------------------+
2 rows in set (0.000 sec)
MariaDB [(none)]> QUIT
Bye

第4步:安装Apache,Ruby和乘客

我们将安装Ruby和Inteplation将用于Apache的乘客应用程序服务器,以便在Ubuntu上为Redmine提供服务

sudo apt install apache2 libapache2-mod-passenger

第5步:在Ubuntu 20.04上安装Redmine

运行以下命令在Ubuntu 20.04 Linux上安装Redmine。

sudo apt install redmine redmine-mysql

当被要求配置数据库时,应答是。

输入数据库的密码:

确认密码:

成功的安装输出如下所示:

......................
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/persistence.rb:705: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/timestamp.rb:105: warning: The called method `_update_record' is defined here
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/mysql/database_statements.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/query_cache.rb:95: warning: The called method `select_all' is defined here
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/statement_cache.rb:90: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/statement_cache.rb:90: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/statement_cache.rb:90: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/statement_cache.rb:90: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
Default configuration data loaded.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

安装Bundler Gem:

sudo gem update
sudo gem install bundler

配置Apache乘客模块。

sudo tee /etc/apache2/mods-available/passenger.conf<<EOF
<IfModule mod_passenger.c>
  PassengerDefaultUser www-data
  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
  PassengerDefaultRuby /usr/bin/ruby
</IfModule>
EOF

现在创建一个符号链接以将Redmine连接到Web文档空间:

sudo ln -s /usr/share/redmine/public /var/www/html/redmine

访问Redmine Web控制台域名

为Redmine创建VirtualHost文件。

sudo vim /etc/apache2/sites-available/redmine.conf

添加配置数据 - 用域名替换projects.theitroad.com。

<VirtualHost *:80>
  ServerAdmin Hyman@theitroad
  DocumentRoot /var/www/html/redmine
  ServerName projects.example.com
  ServerAlias www.projects.example.com
  <Directory /var/www/html/redmine>
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

创建并设置Gemfile.Lock文件的所有权,以便Apache的www-data用户可以访问它:

sudo touch /usr/share/redmine/Gemfile.lock
sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock

按配置为Redmine:

sudo a2ensite redmine.conf
sudo systemctl restart apache2.service

我们现在应该能够使用域访问Redmine:http://projects.example.com

默认登录凭据是:

Username: admin
Password: admin

在下一个屏幕中更改密码。

我们现在有Redmine在Ubuntu 20.04 Linux上工作。

使用IP地址访问Redmine Web控制台

修改默认Apache配置:

sudo tee /etc/apache2/sites-available/000-default.conf<<EOF
<VirtualHost *:80>
  ServerAdmin Hyman@theitroad
  DocumentRoot /var/www/html
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  <Directory /var/www/html/redmine>
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
  </Directory>
</VirtualHost>
EOF

创建并设置Gemfile.Lock文件的所有权,以便Apache的www-data用户可以访问它:

sudo touch /usr/share/redmine/Gemfile.lock
sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock

加载乘客模块并重新启动Apache服务器:

sudo a2enmod passenger
sudo systemctl restart apache2

我们现在应该能够从服务器IP地址或者主机名访问Redmine:http://server_ip_or_hostname/redmine

默认登录凭据是:

Username: admin
Password: admin