banner



How To Install Puma As A Windows Service

Installing Redmine on Windows Server 2008 R2 and Apache with Sparse equally a windows service

Since the last instructions on how to get Redmine running on a windows motorcar are really really old and with the support for Ruby 1.9.three and all I call up its fourth dimension to write a quick tutorial on how to install Redmine on a Windows machine. With every new Redmine relase I was getting more than and more than issues using Mongrel and I finally got Thin working on our server. Now I'1000 not going to write a very detailed tutorial on how to do each bit so you are going to take to arrange these instructions to the official installation instructions. I will not tell you how to install and configure the required software in detail since they depend entirely on your setup merely I will give you lot tips on how to avoid some issues and caveats I faced.

Redmine installed on:
-Windows Server 2008 R2 x64

Software used:
-MySQL Community server 5.v.27 64bit
-Apache ii.four.ii from Apachelounge
-PHP 5.4.v
-PHPMyAdmin 3.5.ii.2
-Ruddy 1.nine.three RubyInstaller

Installing the prequisites:¶

1. become to http://world wide web.mysql.com/downloads/mysql/ and download the latest version of MySQL. Using a 64bit installation is fine. I volition assume you know how to install MySQL and so that you can brand local connections to information technology.

2. go to http://www.apachelounge.com/ and download Apache. The reason I apply the files from this site is that they compile Apache using VC9 instead of VC6 that the official downloads are congenital with. This gives some performance increase and stability when using a mod Os like Windows 7 or Windows Server 2008 R2.

Note 1¶

For PHP v.4 you lot need to download the handler module for apache 2.4 from the same page (php5apache2_4.dll-php-5.4-win32.zip) considering PHP merely provides the handle module upwards to apache ii.3 at the time of writing this text. In one case downloaded unpack information technology and check for which versions of PHP 5.four are included so you know the version to download in the next pace!

Note two¶

While there are also 64bit binaries now available for Apache from Apachelounge many Apache modules are all the same available only for 32bit versions then I have not yet found a working set of modules for 64bit Apache.

If yous dont want to employ PHP and PHPMyAdmin on your server you lot can skip steps 3 and 4.

3. get to http://windows.php.net/download/ and download a version of PHP that yous have a working handler module for from the previous step! If the version on the download page is newer than there is a module handler you lot can find all previous versions of PHP by scrolling down and at that place is a box labeled "Archive" in the left side where you can find a link to the old versions.

4. go to http://world wide web.phpmyadmin.net/home_page/alphabetize.php and download and install PHPMyAdmin. You can too utilize MySQL Workbench or any other fashion to manage your databases. Create a new database for your upcoming redmine and create a user for it. Remember the countersign for the redmine configs.

five. become to http://rubyinstaller.org/downloads/ and download Ruby ane.9.3 p194 installer AND the Development kit. Install Ruby using the installer and rememer to "Add together Ruby executables to your PATH". just the Evolution kit is only a self extracting annal and where ever y'all point it thats where it will exist "installed". After installing the development kit add the path to the <devkit>\bin and <devkit>\mingw\bin to your system PATH. Too note that the installer probably added the Ruby path to just your user so adding it to the system path will aid you to avoid some issues when running the files with unlike users like Organisation etc.
(To view your system path settings: Command Console -> System -> Advanced system settings -> Environment Variables -button. Upper box is user settings and lower box is whole system settings.)

Setting up Redmine and Ruby:¶

1. Download Redmine and unpack it. Copy the files to a desired installation location. For this tutorial I will assume that "C:\Webserver\Redmine" is our desired installation location.

2. Navigate to the root of your Redmine and create a file called: "Gemfile.local". Open up this file and enter the following into it:

# Gemfile.local gem "eventmachine", "~> 1.0.0.rc.4"  gem "sparse"          

iii. open up up a control prompt and verify that your ruby path is working by doing:

ruby -v          

And it should print out your crimson version (1.9.3 p194 when writing this tutorial).

4. install bundle as required by RedmineInstall instructions and then install all the gems with bundle. If yous want to install RMagick check HowTo_Install_Redmine_in_a_sub-URI_on_Windows_with_Apache otherwise use:

bundle install --without evolution test rmagick          

to install all the needed gems. Json seemed to require the Ruby Evolution Kit installed then that is why we installed information technology before.

5. before yous go to creating the database things in step v of the RedmineInstall you need to include the MySQL Connector for MySQL2 jewel. If you get an error after on maxim to install "activerecord-mysql2-adapter" do NOT install it since it will cause other things to break. The error simply means that the connector you are trying to use does not work. I found a working connector from http://dev.mysql.com/downloads/connector/c/ and I used the mysql-connector-c-noinstall-half dozen.0.2-win32.null version. Download the .nix file since yous only demand to copy libmysql.dll within the lib folder in that .zip file to your Reddish bin folder.

half dozen. Finish following RedmineInstall. Notation that in the part where it says

RAILS_ENV=product rake db:migrate          

on windows this volition not piece of work. Utilize:

fix RAILS_ENV=production  rake db:migrate . .          

Setting up Thin as a Windows service and configuring Apache¶

Please NOTE THAT IN THE NEXT STEPS WE EDIT WINDOWS REGISTRY SETTINGS AND IF Yous MESS SOMETHING Upwardly IT Can BRICK YOUR WINDOWS INSTALLATION FOR Adept. I Will Not BE RESPONSIBLE IF YOU DO SOMETHING STUPID BECAUSE OF THESE INSTRUCTIONS AND DESTROY OR MESS UP YOUR OPERATING SYSTEM. If you understand what y'all are doing there is no danger.

i. in the control prompt navigate into your Redmine root folder and test that Sparse works:

thin offset -e production -p 3000          

and afterward it displays that its listening use your webbrowser to navigate to your Redmine installation. Make certain that there are no firewalls etc blocking your connections. One time you take confirmed its working shut information technology downwardly.

2. get to http://www.microsoft.com/en-us/download/details.aspx?id=17657 and download and install the Windows Server 2003 Resource kit. There is no kit for Server 2008 but you dont have to necessarily install the kit to your server. You can install it on your local Windows 7 machine or simply unpack the .exe and .msi with 7zip and copy srvany.exe from the pack to your server. Some people suggest copying srvany.exe to C:\Windows\system32 but I personally make a copy to each folder where the program I desire to run equally service is. And then in this instance I would copy srvany.exe into the Crimson\bin folder considering that is where ruby.exe is located in. (As a fun fact you tin use srvany.exe to make a windows service of pretty much whatever software you utilize.)

3. open up a new control prompt but this time run it with administrator privileges (correct click -> Run as ambassador). Use the following commandline to install srvany.exe as a Windows Service:

SC create MyService binPath= "C:\path to\srvany.exe" DisplayName= "My Custom Service"          

Naturally replace MyService with the name yous want the service to have in the windows registry (we will demand that information in the next step) and Displayname is the one displayed on the Windows Services list. If the creation of the service went okay you should meet something similar "SC create SUCCESS". If you lot messed something upwards use:

SC delete MyService          

to remove the service.

4. Launch RegEdit and navigate to

HKEY_LOCAL_MACHINE\Organization\CurrentControlSet\services\          

In that list you lot should find the service you lot created with the proper noun you used for MyService. Create a new Primal called "Parameters" and add the following strings with the respective data:

Cord: AppDirectory  Data: path to your Redmine root folder for case: C:\Webserver\Redmine          

STRING: Application Information: path to your Ruby.exe for instance: C:\Webserver\Ruby193\bin\cerise.exe          

STRING: AppParameters Information: Thin startup settings and path for example: C:\Webserver\Ruby193\bin\thin start -eastward product -p 3001          

Now you should have a working Windows Service setup with Thin and if y'all go to "Control Panel -> Administrative Tools -> Services" you lot should notice your newly created service in the listing. Start information technology upward and utilise a browser to test Sparse works and browse to the port yous selected with the -p switch and you should have a working Redmine setup there. If you lot edit the service from the Services listing y'all tin change the startup to exist "Automatic" instead of "Transmission" and your service will start automatically when Windows starts. Only since no-one wants to utilise http://www.example.com:3001/ to use your Redmine in the next part we will configure Apache to redirect traffic then that you tin use http://www.example.com equally your Redmine address.

5. Edit your Apache httpd.conf and enable the post-obit modules

LoadModule proxy_module modules/mod_proxy.and so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_http_module modules/mod_proxy_http.so          

Delight note that without proper configuration that I will not go through hither your server might become an open proxy by enabling these modules. Refer to Apache 2.4 documentation on how to make your server Non human activity like an open proxy.

I utilize vhosts to enable our Redmine installation and so make sure that

Include conf/actress/httpd-vhosts.conf          

is not commented out.

6. Hither is an example conf/extra/httpd-vhosts.conf

<VirtualHost *:80>     ServerAdmin webmaster@example.com     ServerName example.com     ServerAlias www.example.com      DocumentRoot "c:/Webserver/Redmine/public"       <Directory "C:/Webserver/Redmine/public">         Crave all granted         Options -MultiViews     </Directory>      ProxyPass / balancer://redmine_cluster/     ProxyPassReverse / balancer://redmine_cluster/     ProxyPreserveHost On      <Proxy balancer://redmine_cluster>         BalancerMember http://127.0.0.i:3001     </Proxy>      ErrorLog  "|C:/Webserver/Apache/bin/rotatelogs.exe logs/example.com/%Y.%m.%d.example.com.fault.log 86400"      CustomLog "|C:/Webserver/Apache/bin/rotatelogs.exe logs/case.com/%Y.%yard.%d.instance.com.access.log 86400" combined </VirtualHost>          

The logging uses apache rotatelogs to rotate the logs for each 24-hour interval. Delight notation that the server will crash if the folders for logs exercise not exist beforehand.

And there you have it. You lot can add more instances of Thin with different -p switch and then just add the aforementioned port to the balancer proxy. I know these instructions are very vague at parts and they are intended to be then. It is to help you assistance yourself by learning how to configure things yourself rather than just copying what others have done. Delight get out comments on what parts I missed or screwed upwardly totally though I most likely will not revisit this thread before I update my Redmine the next time. If someone wants to copy and right any false info on this mail service to a Wiki folio feel free to exercise so. Switching to Sparse had me a update from Redmine 1.4.ane to two.0.three in most 2 hours to go everything figured out and no hassle with the ever more than problematic Mongrel.

RE: Installing Redmine on Windows Server 2008 R2 and Apache with Thin as a windows service - Added by Evgeniy.V Veselov over 8 years agone

Спасибо большое !!!!!

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Redmine]
"Type"=dword:00000110
"Start"=dword:00000003
"ErrorControl"=dword:00000001
"DisplayName"="Redmine Server"
"ObjectName"="LocalSystem"
"ImagePath"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\
20,00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,\
00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,xx,00,52,00,65,00,73,00,6f,00,\
75,00,72,00,63,00,65,00,20,00,4b,00,69,00,74,00,73,00,5c,00,54,00,6f,00,6f,\
00,6c,00,73,00,5c,00,73,00,72,00,76,00,61,00,6e,00,79,00,2e,00,65,00,78,00,\
65,00,00,00

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\Redmine\Parameters]
"AppDirectory"="C:\\web\\Redmine"
"Awarding"="C:\\spider web\\Ruby\\bin\\ruby.exe"
"AppParameters"="C:\\spider web\\Reddish\\bin\\thin offset -e production -p 3001"

И кинуть в каталог с руби библиотеку libmysql.dll

Установка DEVKIT
crimson dk.rb init
ruby dk.rb review
ruby dk.rb install

Установка Mysql2

gem install mysql2 --platform=ruby -- ' --with-mysql-dir="C:\web\mysql-connector"'

gem install bundler
bundle install --without development test rmagick
Миграция плагинов и основы:
rake db:drift
rake redmine:plugins:migrate RAILS_ENV=production

Установка Redmine thin + Apache в http://server/redmine

В environment.rb
Redmine::Utils::relative_url_root = "/redmine"

httpd.conf

ProxyPass /redmine balancer://redmine_cluster
ProxyPassReverse /redmine balancer://redmine_cluster
ProxyPreserveHost On

<Proxy balancer://redmine_cluster>
BalancerMember http://127.0.0.ane:3001/redmine
</Proxy>

AppParameters in HKLM/Organisation/CurentControlSet/Serveces/Redmine Service/paremeters

C:\WebServer\Reddish\bin\thin outset -e production -p 3001 --prefix /redmine

RE: Installing Redmine on Windows Server 2008 R2 and Apache with Sparse equally a windows service - Added by Ana Caroline Lima Marinato about 6 years ago

I followed this steps only something's wrong. Now, when i try to admission 127.0.0.ane:3001 i get fault 500. I have to execute with port 3000. But it only works when the command prompt window is open! Information technology wont work on Apache! The Virtual Hosts file is not working. I don't know what to do anymore. I've been trying for two by now. I realy don't know what is wrong because i don't know what the link between this steps.

It but works when i access the command prompt, navigate into mine redmine root folder, and execute this:

package exec thin start -e production -p 3000

Loading...

How To Install Puma As A Windows Service,

Source: https://www.redmine.org/boards/1/topics/32693

Posted by: cainthournes.blogspot.com

0 Response to "How To Install Puma As A Windows Service"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel