Настройка redmine на debian

Обновлено: 05.07.2024

Redmine should run on most Unix, Linux, macOS and Windows systems as long as Ruby is available on this platform. See specific installation HowTos here.

Ruby interpreter¶

Redmine version Supported Ruby versions Rails version used
trunk (>= r20913) Ruby 2.5, 2.6, 2.7, 3.0 Rails 6.1
4.2 Ruby 2.4, 2.5, 2.6, 2.7 1 Rails 5.2
4.1 Ruby 2.3, 2.4, 2.5, 2.6 Rails 5.2

  • Support of Ruby 2.5 and earlier has been ended by the Ruby community. See the official announcements for details: 2.2, 2.3, 2.4, 2.5.
  • Redmine does not support JRuby because activerecord-jdbc-adapter and loofah do not support Rails 4.2 or later.

Supported database back-ends¶

Optional components¶

  • SCM binaries (eg. svn ), for repository browsing (must be available in your PATH). See RedmineRepositories for SCM compatibility and requirements. (to enable Gantt export to PNG image and thumbnails generation). (to enable thumbnails generation for PDF attachments in Redmine 4.1 or later).

Redmine Version¶

It is recommended that the majority of users install the proper point releases of redmine. Redmine currently releases a new version every 6 months, and these releases are considered very usable and stable. It is not recommended to install redmine from trunk, unless you are deeply familiar with Ruby on Rails and keep up with the changes - Trunk does break from time-to-time.

Installation procedure¶

Step 1 - Redmine application¶

Get the Redmine source code by either downloading a packaged release or checking out the code repository.

See the download page for details.

Step 2 - Create an empty database and accompanying user¶

Redmine database user will be named redmine hereafter but it can be changed to anything else.

MySQL¶

For versions of MySQL 5.5.2 or lower - use utf8 instead of utf8mb4

For versions of MySQL 5.0.2 or lower - skip the 'CREATE USER' step and instead:

PostgreSQL¶

SQLite¶

Skip this step. A database file will be created during Step 6.

SQL Server¶

The database, login and user can be created within SQL Server Management Studio with a few clicks.

If you prefer the command line option with SQLCMD , here's some basic example:

Step 3 - Database connection configuration¶

Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.

Example for a MySQL database (default port):

If your server is not running on the standard port (3306), use this configuration instead:

Example for a PostgreSQL database (default port):

Example for a SQLite database:

Example for a SQL Server database (default host localhost , default port 1433 ):

Step 4 - Dependencies installation¶

Redmine uses Bundler to manage gems dependencies.

You need to install Bundler first if you use Ruby 2.5 or earlier:

Then you can install all the gems required by Redmine using the following command:

Optional dependencies¶

RMagick¶

RMagick is an interface between the Ruby programming language and the ImageMagick image processing library. The library is necessary for Redmine prior to 4.1.0 to export gantt charts to PNG or PDF.

If ImageMagick (6.4.9 - 6.9.10) is not installed on your system and you are installing Redmine 4.0 or earlier, you should skip the installation of the rmagick gem using:

If you have trouble installing rmagick on Windows, refer to this HowTo.

Database adapters¶

Redmine automatically installs the adapter gems required by your database configuration by reading it from the config/database.yml file (eg. if you configured only a connection using the mysql2 adapter, then only the mysql2 gem will be installed).

Don't forget to re-run bundle install --without development test . after adding or removing adapters in the config/database.yml file!

Additional dependencies ( Gemfile.local )¶

If you need to load gems that are not required by Redmine core (eg. Puma, fcgi), create a file named Gemfile.local at the root of your redmine directory. It will be loaded automatically when running bundle install .

Step 5 - Session store secret generation¶

Step 6 - Database schema objects creation¶

Create the database structure, by running the following command under the application root directory:

Windows syntax:

It will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin .

If you get this error with Ubuntu:

Then you need to install libopenssl-ruby1.8 just like this: apt-get install libopenssl-ruby1.8 .

Step 7 - Database default data set¶

Insert default configuration data in database, by running the following command:

Redmine will prompt you for the data set language that should be loaded; you can also define the REDMINE_LANG environment variable before running the command to a value which will be automatically and silently picked up by the task.

Step 8 - File system permissions¶

NB: Windows users can skip this section.

The user account running the application must have write permission on the following subdirectories:

  1. files (storage of attachments)
  2. log (application log file production.log )
  3. tmp and tmp/pdf (create these ones if not present, used to generate PDF documents among other things)
  4. public/plugin_assets (assets of plugins)

E.g., assuming you run the application with a redmine user account:

Note: If you have files in these directories (e.g. restore files from backup), make sure these files are not executable.

Step 9 - Test the installation¶

Test the installation by running WEBrick web server:

Note: Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails ), FCGI or a Rack server (Unicorn, Thin, Puma, hellip;) to serve up your redmine.

Step 10 - Logging into the application¶

Use default administrator account to log in:

You can go to Administration menu and choose Settings to modify most of the application settings.

Configuration¶

Redmine settings are defined in a file named config/configuration.yml .

If you need to override default application settings, simply copy config/configuration.yml.example to config/configuration.yml and edit the new file; the file is well commented by itself, so you should have a look at it.

These settings may be defined per Rails environment ( production / development / test ).

: don't forget to restart the application after any change.

Email / SMTP server settings¶

Email configuration is described in a dedicated page.

SCM settings¶

  • override default commands names if the SCM binaries present in the PATH variable doesn't use the standard name (Windows .bat/.cmd names won't work)
  • specify the full path to the binary

Examples (with Subversion):

Command name override:

Attachment storage settings¶

You can set a path where Redmine attachments will be stored which is different from the default 'files' directory of your Redmine instance using the attachments_storage_path setting.

Logging configuration¶

Redmine defaults to a log level of :info, writing to the log subdirectory. Depending on site usage, this can be a lot of data so to avoid the contents of the logfile growing without bound, consider rotating them, either through a system utility like logrotate or via the config/additional_environment.rb file.

To use the latter, copy config/additional_environment.rb.example to config/additional_environment.rb and add the following lines. Note that the new logger defaults to a high log level and hence has to be explicitly set to info .

Backups¶

  • data (stored in your redmine database)
  • attachments (stored in the files directory of your Redmine install)

Please refer to Backing up and restoring Redmine for more details.

Notes on Linux/Unix installation¶

Be sure to disable security hardenning tools during the installation process if you run into bizarre permission problems. These problems are mostly silent and can be caused by tools like extended ACLs, SELinux, or AppArmor. There tools are mostly used in big companies with a strict security policy, default Linux/Unix distributions settings shouldn't be a problem.

Notes on Windows installation¶

When running command as described in this guide, you have to set the RAILS_ENV environment variable using a separate command.

I.e. commands with the following syntaxes:

have to be turned into 2 subsequent commands:

You may need to manually install the mysql gem using the following command:

Important note for Win7 and later
On Win7 and later, localhost is commented out in the hosts file 5 and IPV6 is the default 6 . As the mysql2 gem does no support IPV6 addresses 7 , a connection can't be established and you get the error " Can't connect to MySQL server on 'localhost' (10061) ".
You can confirm this by pinging localhost , if ping targets "::1:" IPV6 is being used.

Replace localhost with 127.0.0.1 in database.yml.

Alternative to manual installation¶

Some users may prefer to skip manual installation by using one of the third-party Redmine bundles on the download page.

Redmine включает поддержку нескольких проектов, вики, систему отслеживания проблем, форумы, календари, уведомления по электронной почте и многое другое.

В этом руководстве мы покажем вам, как установить и настроить последнюю версию Redmine на сервере Debian 9, используя MySQL в качестве серверной части базы данных и Passenger + Nginx в качестве сервера приложений Ruby.

Подготовка

Прежде чем продолжить работу с этим руководством, убедитесь, что вы выполнили следующие предварительные требования:

Создание базы данных MySQL

Redmine поддерживает MySQL / MariaDB, Microsoft SQL Server, SQLite 3 и PostgreSQL . Мы будем использовать MariaDB в качестве серверной части базы данных. Убедитесь, что на вашем компьютере установлена как минимум MySQL 5.7 или MariaDB 10.3.

Если MariaDB или MySQL не установлены на вашем сервере Debian, вы можете установить их, следуя этим инструкциям .

Начните с входа в консоль MySQL, набрав:

Выполните следующий оператор SQL, чтобы создать новую базу данных :

Не забудьте сменить change-with-strong-password на надежный.

После этого выйдите из консоли MariaDB, набрав:

Установка Ruby

Установите Ruby, набрав:

На момент написания в репозиториях Debian стоит 2.3.3p222 которая поддерживается последней версией Redmine.

Если вы хотите установить Ruby через Rbenv или RVM, посетите это руководство .

Установка Passenger и Nginx

Убедитесь, что Nginx установлен, прежде чем продолжить следующие шаги.

Импортируйте ключ GPG репозитория и включите репозиторий Phusionpassenger :

Обновите список пакетов и установите модуль Passenger Nginx с помощью:

Установка Redmine на Debian

Начните с установки зависимостей, необходимых для сборки Redmine:

На момент написания этой статьи последней стабильной версией Redmine была версия 4.0.4.

Перед тем, как перейти к следующему шагу, вам следует проверить страницу загрузки Redmine, чтобы найти более новую версию.

1. Скачивание Redmine

Загрузите архив Redmine с помощью следующей команды curl :

После завершения загрузки извлеките архив и переместите его в каталог /opt :

2. Настройка базы данных Redmine.

Скопируйте пример файла конфигурации Redmine:

Откройте файл в текстовом редакторе:

Найдите production раздел и введите базу данных MySQL и информацию о пользователе, которую мы создали ранее:

После этого сохраните файл и выйдите из редактора.

3. Установка зависимостей Ruby

Перейдите в каталог redmine и установите бандлер и другие зависимости Ruby:

4. Сгенерируйте ключи и перенесите базу данных.

Выполните следующую команду, чтобы сгенерировать ключи и перенести базу данных:

5. Установите правильные разрешения.

Nginx работает как пользователь и группа www-data . Установите правильные разрешения, выполнив следующую команду chown :

Настроить Nginx

К настоящему времени у вас уже должен быть установлен Nginx с сертификатом SSL в вашей системе, если нет, проверьте предварительные требования для этого руководства.

Откройте текстовый редактор и создайте следующий файл блока сервера Nginx :

Включите блокировку сервера, создав символическую ссылку на каталог sites-enabled :

Перед перезапуском сервиса Nginx проверьте, нет ли синтаксических ошибок:

Если ошибок нет, результат должен выглядеть так:

Доступ к Redmine

Откройте браузер , введите свой домен и, если установка прошла успешно, появится экран, подобный следующему:

Учетные данные для входа в Redmine по умолчанию:

  • Имя пользователя: admin
  • Пароль: admin

При первом входе в систему вам будет предложено изменить пароль, как показано ниже:

После изменения пароля вы будете перенаправлены на страницу учетной записи пользователя.

Выводы

Вы успешно установили Redmine в своей системе Debian. Теперь вам следует проверить документацию Redmine и узнать больше о том, как настроить и использовать Redmine.

Если вы столкнулись с проблемой или хотите оставить отзыв, оставьте комментарий ниже.

Redmine включает поддержку нескольких проектов, вики, систему отслеживания проблем, форумы, календари, уведомления по электронной почте и многое другое.

В этом руководстве описывается, как установить и настроить последнюю версию Redmine на сервере Ubuntu 18.04 с использованием MySQL в качестве серверной части базы данных и Passenger + Nginx в качестве сервера приложений Ruby.

Подготовка

Прежде чем продолжить работу с этим руководством, убедитесь, что вы выполнили следующие предварительные требования:

Создание базы данных MySQL

Redmine поддерживает MySQL / MariaDB, Microsoft SQL Server, SQLite 3 и PostgreSQL . В этом руководстве мы будем использовать MySQL в качестве серверной части базы данных.

Если на вашем сервере Ubuntu еще не установлен MySQL, вы можете установить его, следуя этим инструкциям .

Войдите в оболочку MySQL, набрав следующую команду:

В оболочке MySQL запустите следующий оператор SQL, чтобы создать новую базу данных :

Убедитесь, что вы сменили change-with-strong-password с надежным паролем.

После этого выйдите из консоли mysql, набрав:

Установка Ruby

Установите Ruby, набрав:

Если вы хотите установить Ruby через Rbenv или RVM, ознакомьтесь с этим руководством .

Установка Passenger и Nginx

Убедитесь, что вы выполнили предварительные требования и установили Nginx, прежде чем продолжить следующие шаги.

Начнем с установки необходимых пакетов:

Импортируйте ключ GPG репозитория и включите репозиторий Phusionpassenger :

После включения репозитория apt обновите список пакетов и установите модуль Passenger Nginx с помощью:

Установка Redmine на Ubuntu

Начнем с установки зависимостей, необходимых для сборки Redmine:

На момент написания этой статьи последней стабильной версией Redmine была версия 4.0.0.

Перед тем, как перейти к следующему шагу, вам следует проверить страницу загрузки Redmine, чтобы узнать, доступна ли более новая версия.

1. Скачивание Redmine

Загрузите архив Redmine с помощью следующей команды curl :

После завершения загрузки извлеките архив и переместите его в каталог /opt :

2. Настройка базы данных Redmine.

Начните с копирования примера файла конфигурации Redmine:

Откройте файл в текстовом редакторе:

Найдите production раздел и введите базу данных MySQL и информацию о пользователе, которую мы создали ранее:

После этого сохраните файл и выйдите из редактора.

3. Установка зависимостей Ruby

Перейдите в каталог redmine и установите бандлер и другие зависимости Ruby:

4. Сгенерируйте ключи и перенесите базу данных.

Выполните следующую команду, чтобы сгенерировать ключи и перенести базу данных:

5. Установите правильные разрешения.

Nginx работает как пользователь и группа www-data . Установите правильные разрешения, выполнив следующую команду chown :

Настроить Nginx

К настоящему времени у вас уже должен быть установлен Nginx с сертификатом SSL в вашей системе, если нет, проверьте предварительные требования для этого руководства.

Откройте текстовый редактор и создайте следующий файл блока сервера Nginx :

Включите блокировку сервера, создав символическую ссылку на каталог sites-enabled :

Перед перезапуском сервиса Nginx проверьте, нет ли синтаксических ошибок:

Если ошибок нет, результат должен выглядеть так:

Доступ к Redmine

Откройте браузер , введите свой домен и, если установка прошла успешно, появится экран, подобный следующему:

Учетные данные для входа в Redmine по умолчанию:

  • Имя пользователя: admin
  • Пароль: admin

При первом входе в систему вам будет предложено изменить пароль, как показано ниже:

После изменения пароля вы будете перенаправлены на страницу учетной записи пользователя.

Выводы

Вы успешно установили Redmine в своей системе Ubuntu. Теперь вам следует проверить документацию Redmine и узнать больше о том, как настроить и использовать Redmine.

Если вы столкнулись с проблемой или хотите оставить отзыв, оставьте комментарий ниже.

Redmine включает поддержку нескольких проектов, вики, систему отслеживания проблем, форумы, календари, уведомления по электронной почте и многое другое.

В этом руководстве объясняется, как установить и настроить последнюю версию Redmine на CentOS 8. Мы будем использовать MariaDB в качестве серверной части базы данных и Passenger + Apache в качестве сервера приложений Ruby.

Подготовка

Убедитесь, что вы выполнили следующие предварительные требования:

  • Доменное имя, указывающее на публичный IP-адрес вашего сервера.
  • Вы вошли в систему как root или пользователь с привилегиями sudo .

Создание базы данных MySQL

Redmine поддерживает MySQL / MariaDB, Microsoft SQL Server, SQLite 3 и PostgreSQL . Мы будем использовать MariaDB в качестве серверной части базы данных.

Если на вашем сервере CentOS не установлены MariaDB или MySQL, вы можете установить их, следуя этим инструкциям .

Войдите в оболочку MySQL, используя следующую команду:

Из оболочки MySQL запустите следующие операторы SQL, чтобы создать новую базу данных , нового пользователя и предоставить пользователю доступ к базе данных :

Убедитесь, что вы сменили change-with-strong-password с надежным паролем.

После этого выйдите из оболочки MySQL:

Установка Passenger, Apache и Ruby

После включения репозитория обновите список пакетов и установите Ruby, Apache и Passenger:

Запустите службу Apache и включите ее запуск при загрузке:

Создание нового системного пользователя

Создайте нового пользователя и группу с домашним каталогом /opt/redmine который будет запускать экземпляр Redmine:

Добавьте пользователя apache в группу redmine и измените /opt/redmine доступа к redmine /opt/redmine чтобы Apache мог получить к нему доступ:

Установка Redmine

На момент написания последней стабильной версии Redmine была версия 4.1.0.

Прежде чем перейти к следующим шагам, посетите страницу загрузки Redmine, чтобы узнать, доступна ли более новая версия.

Установите компилятор GCC и библиотеки, необходимые для сборки Redmine:

Убедитесь, что вы выполняете следующие шаги как пользователь redmine :

1. Скачивание Redmine

Скачайте архив Redmine с помощью curl :

После завершения загрузки распакуйте архив:

2. Настройка базы данных Redmine.

Скопируйте пример файла конфигурации базы данных Redmine:

Откройте файл в текстовом редакторе:

Найдите production раздел и введите базу данных MySQL и информацию о пользователе, которую мы создали ранее:

После этого сохраните файл и выйдите из редактора.

3. Установка зависимостей Ruby

Перейдите в redmine-4.1.0 и установите зависимости Ruby:

4. Сгенерируйте ключи и перенесите базу данных.

Выполните следующую команду, чтобы сгенерировать ключи и перенести базу данных:

Настройка Apache

Вернитесь к своему пользователю sudo и создайте следующий файл Apache vhost :

Настроить Apache с SSL

После создания сертификата отредактируйте конфигурацию Apache следующим образом:

Доступ к Redmine

Откройте браузер , введите свой домен и, если установка прошла успешно, появится экран, подобный следующему:

Учетные данные для входа в Redmine по умолчанию:

  • Имя пользователя: admin
  • Пароль: admin

Когда вы входите в систему в первый раз, вам будет предложено изменить пароль, как показано ниже:

После изменения пароля вы будете перенаправлены на страницу учетной записи пользователя.

Если вы не можете получить доступ к странице, возможно, ваш брандмауэр блокирует порты Apache.

Используйте следующие команды, чтобы открыть нужный порт:

Выводы

Вы успешно установили Redmine в своей системе CentOS. Теперь вам следует проверить документацию Redmine и узнать больше о том, как настроить и использовать Redmine.

Если вы столкнулись с проблемой или хотите оставить отзыв, оставьте комментарий ниже.

Official Redmine packages are available for Debian. As of July 2018, stable version 3.4.11 is supported in Debian 9.

If you will be using Redmine in a production environment requiring long term support and stability using official packages is recommended. You will be receiving automatic feature and security updates.

Installing from sources¶

If you want the very latest Redmine version and are comfortable doing manual upgrades and system administration, the following steps will guide you through installing Redmine from sources.

1. Install the pre-requisites for Redmine and all its packages.

2. Install your database of choice.

3. If installing Postgres, install dev.

4. Choose a directory where to install Redmine. In this example /opt used. You can use another location, but you will need to update the following steps as necessary based on your choice.

Install Redmine in /opt

Get Redmine - use the download page and review the functionality that you need to determine the right version for you.

5. Login as the default postgres user and create a new role and database. Use your own password.

then press CTRL-D to escape the shell.

edit /etc/postgresql/9.6/main/pg_hba.conf and set Postgres to trust :

6. Create the /opt/redmine/redmine-3.4.11/config/database.yml file with the following contents…

Note that the spacing is important in this file. Under the “Production” line, each other line must be indented by two spaces, not tabs. Replace your_password with the password specified above. Remember to save. Keep in mind Postgresql passwords can't start with @ character (or other non alpha numerics).

7. Next, set up the database schema and load the initial database.

8.Do a quick test to verify that redmine is working using webrick.

9. Next, let’s set up Apache.

9.1 Create a symbolic link which points from the Apache working directory to the Redmine public folder

9.2 Create a new vhost configuration

9.3 add this line to /etc/apache2/mods-available/passenger.conf in the body of the document- not just the 1st line.

Restart the Apache web server:

And hopefully, you're up and running.

A tutorial updated in 2018 (01/10/2018), in French, which repeats step by step the installation of Redmine since the package proposed in the official repositories of Debian Stretch 9.

Читайте также: