- Redmine
- Latest releases¶
- Resources¶
- HowTo Install Redmine in a sub-URI on Windows with Apache¶
- Install Apache HTTP server 2.2.x¶
- Install MySQL 5.1.x¶
- Install MySQL Workbench 5.2.x¶
- Install PHP 5.3.x¶
- Install Ruby 1.8.7 with RubyGems¶
- Additional gems¶
- Install Rake¶
- Install Rails¶
- Install i18n¶
- Install Mongrel¶
- Install mysql gem¶
- Install mongrel-service + win32-service gems¶
- Install Redmine¶
- Setup windows services¶
- Configure Apache 2.2.x as proxy to Mongrel cluster¶
- Additional components¶
- Install RMagic¶
- Add redmine_attach_screenshot plugin¶
- Установка Redmine. Полная пошаговая инструкция. Для чайников.
Redmine
Latest releases¶
Resources¶
HowTo Install Redmine in a sub-URI on Windows with Apache¶
Following the steps below exactly as listed will produce a working Redmine installation hosted under http://localhost/redmine sub-URI on Windows XP/2003/2008 x86/x64 with Apache HTTP Server 2.2.x, MySQL 5.1.x, PHP 5.3.x and Ruby 1.8.7.
This walk-through was tested with Redmine 1.0.4.devel.4543 but should work with any version >= 0.8 .
The intended audience for this walk-through are Windows users.
Install Apache HTTP server 2.2.x¶
- Download «Win32 Binary without crypto (no mod_ssl) (MSI Installer)» or «Win32 Binary including OpenSSL (MSI Installer)», depending if you intend to use SSL on your webserver, from here
- Install to C:\webserver\Apache\
Install MySQL 5.1.x¶
- Download «Windows (x86, 32-bit), MSI Installer — Essentials — Recommended» from here
- (the 64-bit version could be installed on x64 Windows platforms, but the 32-bit version is and it works well on both x86 and x64 versions of Windows.)
- Install to C:\webserver\MySQL\
- During initial setup:
- (optional:) set data files installation directory to C:\webserver\MySQL_Data\
- During Server Instance Configuration Wizard:
- (optional:) Add firewall exception for the port used
- set to «Best Support for Multilingualism» UTF8
- select «Include Bin Directory in Windows PATH»
- During initial setup:
Install MySQL Workbench 5.2.x¶
- Download «Windows (x86, 32-bit), MSI Installer» from here
- Install to C:\webserver\MySQL_Workbench\
Install PHP 5.3.x¶
- Download «VC6 x86 Thread Safe — Installer» from here
- Install to C:\webserver\PHP\
- During setup:
- for webserver, choose «Apache 2.2.x Module»
- configuration directory is «C:\webserver\Apache\conf\»
- you can leave all default Extensions as they are, optionally adding «Internationalization» and «Multi-Byte String»
- During setup:
Install Ruby 1.8.7 with RubyGems¶
- At the time of writing this document the latest version of Ruby was 1.9.2, however for best compatibility use .
- Download «rubyinstaller-1.8.7-p302.exe» from here
- Install to C:\webserver\Ruby\
- During setup, select «Add Ruby executables to your PATH»
- Verify Ruby version
- Open command window, execute:
- expected output:
- Open command window, execute:
- Verify RubyGems version
- in command window, execute:
- expected output:
- At the time of writing this document the latest version of RubyGems was 1.3.7. Versions >= 1.5.0 won’t work with Redmine 1.1.x.
- expected output:
- in command window, execute:
- If you get errors about missing «SSLEAY32.dll», install PHP as shown above and this dll will become available
Additional gems¶
- mongrel-service and win32-service gems have to be downloaded manually. Download locations are added to sections below.
Install Rake¶
- At the time of writing this document the latest version of Rake was 0.8.7. Newer versions should work too.
- Install Rake gem
- in command window, execute:
- expected output:
- in command window, execute:
Install Rails¶
- At the time of writing this document, the latest version of Rails is 3.0.3, but Redmine 1.0.4 installation requires Rails 2.3.5.
- Install Rails gems
- in command window, execute:
- expected output:
- in command window, execute:
Install i18n¶
- At the time of writing this document, the latest version of i18n is 0.5, but Redmine 1.0.4 installation requires i18n 0.4.2.
- Install i18n gem
- in command window, execute:
- expected output:
- in command window, execute:
Install Mongrel¶
- At the time of writing this document the latest version of Mongrel was 1.1.5. Newer versions should work too.
- Project page
- Install Mongrel gems
- in command window, execute:
- expected output:
- in command window, execute:
Install mysql gem¶
- At the time of writing this document the latest version of mysql gem was 2.8.1. Newer versions should work too.
- It drastically improves page generation speed.
- Install mysql gem
- in command window, execute:
- expected output:
- The gem was made for MySQL 5.0 so there are some additional features in 5.1 which will not be defined, so you will see a number of lines about missing definitions, but it does not cause any problems
- in command window, execute:
Install mongrel-service + win32-service gems¶
- At the time of writing this document the latest version of win32-service was 0.7 which does NOT work with Ruby 1.8.7
- Use only win32-service version 0.5.2 for Redmine deployment.
- Download «mongrel_service-0.3.4-i386-mswin32.gem» from here
- Move mongrel_service-0.3.4-i386-mswin32.gem to C:\webserver\
- Download «win32-service-0.5.2-mswin32.gem» from here
- This file is also attached at the bottom of this wiki page
- Move win32-service-0.5.2-mswin32.gem to C:\webserver\
- Install the gem
- in command window, execute:
- expected output:
- in command window, execute:
- Delete the two .gem files from C:\webserver\
Install Redmine¶
- Procedure below assumes we will be installing Redmine 1.0.4, but it also works with any revisions >= r3235
- Download «redmine-1.0.4.zip» from here
- Extract the contents of the directory in the archive to C:\webserver\Redmine
- Log into MySQL as root using «MySQL Workbench». You can also use command prompt or another tool, such as «MySQL GUI Tools» or «phpMyAdmin».
- «Open connection to Start Querying»
- In SQL Query window enter the following script:
- «Execute SQL Script in Connected Server»
- You should of course change redmineUser and myPassword to something different.
- Copy C:\webserver\Redmine\config\database.yml.example to C:\webserver\Redmine\config\database.yml
- Edit C:\webserver\Redmine\config\database.yml file to configure your database settings for «production» environment. It should look like this:
- Set username and password to the values entered in the SQL script above.
- Save and close the file.
- Create (or update) Redmine database tables
- in command window, execute:
- If you encounter this error: Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB :
- download libmySQL.dll from here
- move this .dll file to C:\webserver\Ruby\bin\
- in command window, again execute:
- If you encounter this error: Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB :
- in command window, execute:
- If this is a fresh install, you can pre-populate the tables with default data
- in command window, execute:
- Assuming that we will be hosting Redmine under http://localhost/redmine
- Edit C:\webserver\Redmine\config\environment.rb file to configure Redmine to work as a sub-URI (Apache configuration is also required and is listed later on in this document).
- add the following line at the bottom of the file:
- save and close the file.
- This is a preferred way of setting up the application prefix. Mongrel_rails service «—prefix» directive does work with Rails 2.3.x
- Optionally, you can add a following initializer, but ONLY IF you want to use «—prefix» in «Mongrel_rails service» command of changing «environment.rb»:
- Create a file config/initializers/patch_for_mongrel.rb [name of file can be anything]:
- Optionally, you can add a following initializer, but ONLY IF you want to use «—prefix» in «Mongrel_rails service» command of changing «environment.rb»:
Setup windows services¶
- Memory usage is greatly affected by the number of mongrels running. Keep that in mind when deciding on how many processes you want to run. For example, memory usage on Windows Server 2003 x64 SP2:
- Apache = 5MB + 20MB + 40MB = 65MB
- MySQL = 35MB
- Mongrel cluster = number-of-mongrel_rails-services x (3MB + 90MB) = 279MB (@3 processes)
- Create windows services
- in command window (opened as admin!), execute:
- Start windows services, which in turn will start mongrel servers
- in command window, execute:
- Go to the Windows Services list and set all «Mongrel serving Redmine on 300#» services to start automatically
- in command window, execute:
- find each one of «Mongrel serving Redmine on 300#» services
- right click, select Properties
- set Startup type to «Automatic»
- press OK and repeat for the remaining Mongrel services.
- Alternatively you can execute this command on elevated command prompt for each mongrel service installed:
Configure Apache 2.2.x as proxy to Mongrel cluster¶
- Procedure below assumes we will be hosting Redmine under http://localhost/redmine and must match the relative_url_root set above
- Open C:\webserver\Apache\conf\httpd.conf
- At the bottom of this file add the following line:
- Create a file C:\webserver\Apache\conf\httpd-proxy-mongrel.conf
- Enter the following:
- Restart the Apache service.
- in command window, execute:
Your local installation of Redmine is now accessible at http://localhost/redmine
Additional components¶
Install RMagic¶
- Download «RMagick-2.12.0-ImageMagick-6.5.6-8-Q8.zip» or a later version from here
- Extract «rmagick-2.12.0-x86-mswin32.gem» to C:\webserver\
- Install «ImageMagick-6.5.6-8-Q8-windows-dll.exe» to C:\webserver\ImageMagick
- Install the RMagic gem
- in command window, execute:
- expected output:
- in command window, execute:
- Delete the .gem file from C:\webserver\
- Reboot your server. (I was unsuccessful trying to get it to work without rebooting)
Add redmine_attach_screenshot plugin¶
- download source from here
- Extract the archive to C:\webserver\Redmine\vendor\plugins\redmine_attach_screenshot
- Restart the Mongrel cluster
- in command window, execute:
win32-service-0.5.2-mswin32.gem — a working win32-service gem (41 КБ) Jack Kurzecki, 2010-02-01 10:38
Установка Redmine. Полная пошаговая инструкция. Для чайников.
Redmine — на мой взгляд, лучшее из свободно доступных решений для управления проектами, задачами, ведения статистики и отчетности и много еще чего. Все зависит от требований, фантазии и умений системного администратора \ разработчика.
Итак, перековыряв 100500 разных мануалов по установке и на Хабре и на официальном сайте и в куче блогов, я таки нашел инструкцию, которая от начала и до конца меня устроила и теперь дает возможность за 15 минут установить\обновить\переустановить Redmine 2.x, 3.x
В моем случае я осуществил переезд со старого Redmine 1.4 на новый 3.2, поэтому первые 8 пунктов в случае установки с 0 можно пропустить.
1. Создаю каталог, в который положу резервную копию старого Redmine
2. Становлюсь суперпользователем для возможности скопировать файлы.
3. Копирую файлы пользователей старого Redmine в созданный выше каталог.
cp -f /var/lib/redmine/default/files/* /home/usefree/redmine-backup-files/
4. Создаю дамп базы данных. Здесь важно знать учетные данные пользователя, под которым Redmine обращается в базу. Подсмотреть можно в файле /каталог_с_Redmine/config/database.yml
5. Выхожу из учетной записи суперпользователя
6. Перехожу в свой домашний каталог и создаю архив с данными резервной копии.
cd /home/usefree/ tar -cvzf redmine-backup-files.tar.gz /home/usefree/redmine-backup-files
7. Так как я разворачиваю новый Redmine на новом компьютере, то копирую файлы на этот новый компьютер с ip-адресом 192.168.0.222 в свой домашний каталог:
scp redmine-backup-files.tar.gz 192.168.0.222:/home/usefree/
8. Зайдя на этот компьютер, извлекаю файлы
tar -xvf redmine-backup-files.tar.gz
9. Приступаю к собственно установке. Начинаю с обновления пакетов в системе.
sudo apt-get update sudo apt-get upgrade
10. Устанавливаю некоторые дополнительные пакеты.
sudo apt-get install curl gpg —keyserver hkp://keys.gnupg.net —recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -sSL https://get.rvm.io | bash -s stable —ruby=2.0.0 source /home/$USER/.rvm/scripts/rvm sudo apt-get install git git-core subversion sudo apt-get install imagemagick libmagickwand-dev sudo apt-get install libssl-dev
11. Создаю каталог для Redmine, назначаю владельца каталога.
cd /opt/ sudo mkdir redmine sudo chown $USER:$USER redmine
12. Копирую из репозитория Redmine 3.2
cd redmine/ svn co http://svn.redmine.org/redmine/branches/3.2-stable current cd current/
13. Создаю дополнительные каталоги, назначаю им права.
mkdir -p tmp tmp/pdf public/plugin_assets sudo chown -R www-data:$USER files log tmp public/plugin_assets sudo chmod -R 775 files log tmp public/plugin_assets mkdir -p /opt/redmine/repos/svn /opt/redmine/repos/git sudo chown -R www-data:www-data /opt/redmine/repos
14. Устанавливаю инструменты для работы с базой данных и пр.
sudo apt-get install mysql-server libmysqlclient-dev sudo apt-get install -y libgmp3-dev sudo apt-get install ruby-dev
15. Создаю базу данных
mysql -uroot -p CREATE DATABASE redmine CHARACTER SET utf8; CREATE USER ‘redmine’@’localhost’ IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON redmine.* TO ‘redmine’@’localhost’; FLUSH PRIVILEGES; EXIT;
16. Создаю конфигурационные файлы
cp config/configuration.yml.example config/configuration.yml cp config/database.yml.example config/database.yml
17. Заполняю конфигурационный файл учетными данными для подключения к базе данных.
vi config/database.yml production: adapter: mysql2 database: redmine host: localhost username: redmine password: «password» encoding: utf8
18. Установка менеджера gem-пакетов, установка пакетов зависимостей
gem install bundler bundle install —without development test
19. Импортирую данные из старой базы данных
bundle exec rake generate_secret_token
20. Копирую старые файлы пользователей в новый каталог, назначаю им права
cp -f /home/usefree/home/usefree/redmine-backup-files/* /opt/redmine/current/files/ sudo chown -R www-data:www-data /opt/redmine/current/files/
21. Инициализирую базу данных
RAILS_ENV=production bundle exec rake db:migrate
22. Устанавливаю Web-сервер и дополнительные пакеты
sudo apt-get install apache2 apache2-dev libcurl4-gnutls-dev apache2 libapache2-svn \ libapache-dbi-perl libapache2-mod-perl2 libdbd-mysql-perl libauthen-simple-ldap-perl openssl
23. Включаю модули web-сервера
sudo a2enmod ssl perl dav dav_svn dav_fs rewrite
24. Устанавливаю gem-пакет для связи Redmine и web-сервера
gem install passenger passenger-install-apache2-module
Тут может появиться ошибка типа такой
/Users/builder/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:23:in `source’: uninitialized constant Gem::Source (NameError)
Решение такое (может отличаться версия ruby):
https://github.com/fastlane/fastlane/issues/6066
До конца выполнения последней команды будет сгенерирован код, который необходимо поместить в файл passenger.conf (следующий пункт инструкции). Поместить, и только потом нажать Enter !
25. Настраиваю конфигурационный файл модуля web-сервера для связи с redmine. Внимание! текст для файла
passenger.conf генерируется в ходе выполнения предыдущей команды, для корректной установки до завершения выполнения предыдущей команды необходимо тот код, который она выдаст, поместить в файл /etc/apache2/conf-available/passenger.conf . Об этом будет написано английским по серому!
sudo vi /etc/apache2/conf-available/passenger.conf LoadModule passenger_module /home/usefree/.rvm/gems/ruby-2.0.0-p643/gems/passenger-5.0.25/buildout/apache2/mod_passenger.so PassengerRoot /home/usefree/.rvm/gems/ruby-2.0.0-p643/gems/passenger-5.0.25 PassengerDefaultRuby /home/usefree/.rvm/gems/ruby-2.0.0-p643/wrappers/ruby
26. Включаю модуль
sudo a2enconf passenger
27. Загружаю библиотеку Redmine.pm для аутентификации в репозиториях
sudo mkdir /usr/lib/perl5/Apache sudo ln -s /opt/redmine/current/extra/svn/Redmine.pm /usr/lib/perl5/Apache/
28. Настраиваю безопасное подключение по https с использованием самостоятельно сгенерированного сертификата.
sudo mkdir /etc/apache2/ssl sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/apache2/ssl/redmine.key -out /etc/apache2/ssl/redmine.crt sudo chmod -R 740 /etc/apache2/ssl sudo chown -R www-data:www-data /etc/apache2/ssl
29. Создаю конфигурационные файлы виртуальных хостов web-сервера.
sudo vi /etc/apache2/sites-available/redmine-redirect.conf sudo vi /etc/apache2/sites-available/redmine.conf
смотреть оригинальный пост
30. Выключаю сайт по-умолчанию
sudo a2dissite 000-default
31. Возвращаем удаленный выше bundler
gem install bundler
32. Включаю сайт для redmine, перезапускаю web-сервер
sudo a2ensite redmine redmine-redirect sudo service apache2 restart
33. Настраиваю доставку уведомлений на почту при изменении в задачах.
vi /opt/redmine/current/config/configuration.yml default: email_delivery: delivery_method: :smtp attachments_storage_path: /opt/redmine/current/files production: email_delivery: delivery_method: :smtp smtp_settings: address: «mailserver.yourdomain.com» port: 25 domain: «yourdomain.com»
34. Если вдруг забыт пароль админа(admin), то переустановить его на ‘password’ можно так:
mysql -u redmine -p #enter: UPDATE users SET hashed_password=’353e8061f2befecb6818ba0c034c632fb0bcae1b’ WHERE login=’admin’; UPDATE users SET salt=» WHERE login=’admin’; exit;
Огромное спасибо Martin Denizet за труд по подготовке такой суперподробной и понятной инструкции.
Чуть погодя опишу установку некоторых дополнительных плагинов.