how to deploy your rails application on windows
TRANSCRIPT
![Page 1: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/1.jpg)
RubyConf 2014 Lightning Talk
How to deploy your Rails application on Windowsshesee
![Page 2: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/2.jpg)
shesee
Rails developer @ Taipei
» Ruby Taiwan Community
» Ruby Conf 2014 staff
» Rails Girls Coach
» Traffic-related engineering
» 5xRuby Inc.
» Optimis Corp.
![Page 3: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/3.jpg)
They saidRails hates Windows
![Page 4: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/4.jpg)
They saidRails hates Windows
True story.
![Page 5: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/5.jpg)
True stroy
A rails application
needs to be deployed on Windows server 2003
![Page 6: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/6.jpg)
True stroy
A rails application
needs to be deployed on Windows server 2003
>> 2013.years - 2003.years
=> 10 years
![Page 7: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/7.jpg)
Enviroment10+ years old machine
» Windows server 2003
» IIS 6
![Page 8: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/8.jpg)
There's Plan AHelicon Zoo
A repository of web frameworks and applicationsfor Microsoft IIS
http://www.helicontech.com/zoo/
![Page 9: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/9.jpg)
There's Plan AHelicon Zoo
A repository of web frameworks and applicationsfor Microsoft IIS
But not for the 10 years old Windows system
![Page 10: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/10.jpg)
Plan B
Setting Rails enviroment
RailsInstaller(http://railsinstaller.org)
It's simple and friendly for Microsoft users :)
![Page 11: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/11.jpg)
Plan B
Setting Rails enviroment
There's a bisic rails application,you might need to be
$ gem install bundler$ gem install rake$ bundle install$ rake assets:precompile
etc...
![Page 12: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/12.jpg)
Plan B
gem 'thin'
This is our rails application server,which actually response the request.
$ thin --prefix=/yourapp -e production
![Page 13: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/13.jpg)
Plan B
Reverse proxy server
This is our plan:Make IIS 6 been a reverse proxy server !
![Page 14: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/14.jpg)
Plan B
Reverse proxy server - IIS6 with IIRF2.1
We need somethingto turn IIS6 to be a reverse proxy server
IIRF 2.1(http://iirf.codeplex.com/releases/view/58734)
![Page 15: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/15.jpg)
Plan B
East install
Next, next and more next
![Page 16: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/16.jpg)
Plan B
Successful <3
Checkout ISAPI
![Page 17: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/17.jpg)
Plan B
Put it under IIS 6
Put the "public" folder under IIS 6[Setting its URI]
And adding an IIRF.ini (config), it suppports regex
![Page 18: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/18.jpg)
Plan B
Put it under IIS 6
Put the "public" folder under IIS 6[Setting its URI]
And adding an IIRF.ini (config), it suppports regex
Example
RewriteLog AppPath\log\iirf.log
ProxyPass ^/(.*)$ http://localhost:3000/$1 [I]
![Page 19: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/19.jpg)
Plan B
However you get a nacked website
Cause the URI path, asset pipeline can't be the default path now.
![Page 20: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/20.jpg)
Plan B
However you get a nacked website
Cause the URI path, asset pipeline can't be the default path now.
Solution
Also put the "assets" folder under IIS 6
Original: http://domain
New: http://domain/URI
![Page 21: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/21.jpg)
Plan B
Review our action
1.Install RubyInstaller
![Page 22: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/22.jpg)
Plan B
Review our action
1.Install RubyInstaller
2.Install gem & bundler
![Page 23: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/23.jpg)
Plan B
Review our action
1.Install RubyInstaller
2.Install gem & bundler
3.Install IIRF 2.1
![Page 24: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/24.jpg)
Plan B
Review our action
1.Install RubyInstaller
2.Install gem & bundler
3.Install IIRF 2.1
4.Put on IIS
![Page 25: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/25.jpg)
Plan B
Review our action
1.Install RubyInstaller
2.Install gem & bundler
3.Install IIRF 2.1
4.Put on IIS
5.Add public/iirf.ini
![Page 26: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/26.jpg)
You just need toclick "next"
![Page 27: How to deploy your Rails application on Windows](https://reader033.vdocuments.us/reader033/viewer/2022052210/55d5072cbb61eb55338b46d6/html5/thumbnails/27.jpg)
Thanks.Download this slide
http://carolHsu/rubyconf2014LT