Windows redmine all in one

Установка автономного сервера Redmine в Windows

Эта инструкция является компиляцией материалов из различных источников.
Для установки не требуется специальных знаний, достаточно навыков работы с командной строкой Windows.
Надеюсь, эта инструкция будет полезна для тех, кто не особо вдается в тонкости администрирования, но хочет использовать Redmine, то есть для начальников отделов разработки или технической поддержки в небольших организациях.

Для простоты изложения будем считать что у нас диск C: доступен для записи и мы будем все устанавливать на него. Эксперименты производилась под Windows 7 SP1, инструкция проверялась на Windows XP SP3.

  • Загружаем последнюю версию RubyInstaller со страницы http://rubyinstaller.org/downloads/, на момент написания статьи это Ruby 1.9.3-p194.
  • Запускаем загруженный файл, выбираем установочный каталог C:\ruby, выбираем «Add Ruby executables to your PATH» и «Associate .rb and .rbw files with this Ruby installation», устанавливаем.
  • С этой же страницы загружаем последнюю версию DevKit, на момент написания статьи это версия 4.5.2-20111229-1559, запускаем, каталог распаковки указываем C:\ruby\devkit.
  • Запускаем окно командной строки, переходим в каталог c:\ruby\devkit
  • Выполняем команду ruby dk.rb init
  • Выполняем команду ruby dk.rb install
  • Обновляем установленные пакеты командой gem install . Замечание: gem не работает с кириллическими именами каталогов под Windows XP, для устранения проблемы создайте каталог c:\userhome и в переменных среды установите HOME в c:\userhome
  • Устанавливаем Bundler командой gem install bundler
  • Загружаем последнюю версию Redmine со страницы http://rubyforge.org/frs/?group_id=1850 (на момент написания инструкции это версия 2.0.3)
  • Извлекаем содержимое архива в каталог c:\redmine (для удобства просто распаковываем архив в корень C: и переименовываем каталог в redmine)
  • В окне командной строки переходим в каталог c:\redmine
  • Выполняем команду bundle install —without rmagick (rmagick не особо нужен, поэтому я не стал разбираться с возникшими проблемами, когда пытался его установить)
  • Выполняем команду rake generate_secret_token
  • В каталоге c:\redmine\config создаем файл database.yml со следующим содержимым:
  • Выполняем команду rake db:upgrade RAILS_ENV=»production»
  • Выполняем команду rake redmine:load_default_data RAILS_ENV=»production» , при запросе языка выбираем ru.
  • Запускаем сервер в каталоге c:\redmine командой ruby script/rails s -e «production»
  • В браузере переходим по адресу http://localhost:3000, после небольшой паузы должна появиться начальная страница Redmine. Входим под именем admin с паролем admin, переходим на страницу «My account», устанавливаем язык в Русский.

Поздравляю, вы запустили для своей организации автономный сервер Redmine без Apache, MySQL и других зависимостей. Для бэкапа достаточно отключить сервер redmine и сделать архив каталога c:\redmine.
Запуск сервера можно осуществлять bat-файлом с вышеуказанной командой из автозагрузки. Или можно воспользоваться информацией со страницы http://www.redmine.org/projects/redmine/wiki/HowTo_run_Redmine_as_a_Windows_service_(win32-service_+_taskill_approach) для запуска Redmine как сервиса.

Читайте также:  Команды freedos для установки windows

Данная статья не подлежит комментированию, поскольку её автор ещё не является полноправным участником сообщества. Вы сможете связаться с автором только после того, как он получит приглашение от кого-либо из участников сообщества. До этого момента его username будет скрыт псевдонимом.

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¶

  1. 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
  2. Install to C:\webserver\Apache\

Install MySQL 5.1.x¶

  1. 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.)
  2. Install to C:\webserver\MySQL\
    • During initial setup:
      1. (optional:) set data files installation directory to C:\webserver\MySQL_Data\
    • During Server Instance Configuration Wizard:
      1. (optional:) Add firewall exception for the port used
      2. set to «Best Support for Multilingualism» UTF8
      3. select «Include Bin Directory in Windows PATH»

Install MySQL Workbench 5.2.x¶

  1. Download «Windows (x86, 32-bit), MSI Installer» from here
  2. Install to C:\webserver\MySQL_Workbench\

Install PHP 5.3.x¶

  1. Download «VC6 x86 Thread Safe — Installer» from here
  2. Install to C:\webserver\PHP\
    • During setup:
      1. for webserver, choose «Apache 2.2.x Module»
      2. configuration directory is «C:\webserver\Apache\conf\»
      3. you can leave all default Extensions as they are, optionally adding «Internationalization» and «Multi-Byte String»

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 .
  1. Download «rubyinstaller-1.8.7-p302.exe» from here
  2. Install to C:\webserver\Ruby\
  3. During setup, select «Add Ruby executables to your PATH»
  4. Verify Ruby version
    • Open command window, execute:
      • expected output:
  5. 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.
  • 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.
  1. Install Rake gem
    • in command window, execute:
      • expected output:
Читайте также:  Терминал для трейдинга mac os

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.
  1. Install Rails gems
    • in command window, execute:
      • expected output:

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.
  1. Install i18n gem
    • in command window, execute:
      • expected output:

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
  1. Install Mongrel gems
    • in command window, execute:
      • expected output:

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.
  1. 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

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.
  1. Download «mongrel_service-0.3.4-i386-mswin32.gem» from here
  2. Move mongrel_service-0.3.4-i386-mswin32.gem to C:\webserver\
  3. Download «win32-service-0.5.2-mswin32.gem» from here
    • This file is also attached at the bottom of this wiki page
  4. Move win32-service-0.5.2-mswin32.gem to C:\webserver\
  5. Install the gem
    • in command window, execute:
      • expected output:
  6. 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
  1. Download «redmine-1.0.4.zip» from here
  2. Extract the contents of the directory in the archive to C:\webserver\Redmine
  3. Log into MySQL as root using «MySQL Workbench». You can also use command prompt or another tool, such as «MySQL GUI Tools» or «phpMyAdmin».
    1. «Open connection to Start Querying»
    2. In SQL Query window enter the following script:
    3. «Execute SQL Script in Connected Server»
      • You should of course change redmineUser and myPassword to something different.
  4. Copy C:\webserver\Redmine\config\database.yml.example to C:\webserver\Redmine\config\database.yml
  5. Edit C:\webserver\Redmine\config\database.yml file to configure your database settings for «production» environment. It should look like this:
    1. Set username and password to the values entered in the SQL script above.
    2. Save and close the file.
  6. 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 :
        1. download libmySQL.dll from here
        2. move this .dll file to C:\webserver\Ruby\bin\
        3. in command window, again execute:
  7. If this is a fresh install, you can pre-populate the tables with default data
    • in command window, execute:
  8. 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]:
Читайте также:  Hp b210b windows 10

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)
  1. Create windows services
    1. in command window (opened as admin!), execute:
  2. Start windows services, which in turn will start mongrel servers
    1. in command window, execute:
  3. Go to the Windows Services list and set all «Mongrel serving Redmine on 300#» services to start automatically
    1. in command window, execute:
    2. find each one of «Mongrel serving Redmine on 300#» services
    3. right click, select Properties
    4. set Startup type to «Automatic»
    5. 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
  1. Open C:\webserver\Apache\conf\httpd.conf
  2. At the bottom of this file add the following line:
  3. Create a file C:\webserver\Apache\conf\httpd-proxy-mongrel.conf
  4. Enter the following:
  5. Restart the Apache service.
    • in command window, execute:

Your local installation of Redmine is now accessible at http://localhost/redmine

Additional components¶

Install RMagic¶

  1. Download «RMagick-2.12.0-ImageMagick-6.5.6-8-Q8.zip» or a later version from here
  2. Extract «rmagick-2.12.0-x86-mswin32.gem» to C:\webserver\
  3. Install «ImageMagick-6.5.6-8-Q8-windows-dll.exe» to C:\webserver\ImageMagick
  4. Install the RMagic gem
    • in command window, execute:
      • expected output:
  5. Delete the .gem file from C:\webserver\
  6. Reboot your server. (I was unsuccessful trying to get it to work without rebooting)

Add redmine_attach_screenshot plugin¶

  1. download source from here
  2. Extract the archive to C:\webserver\Redmine\vendor\plugins\redmine_attach_screenshot
  3. 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

Оцените статью