Skip to content

Instantly share code, notes, and snippets.

@barek2k2
Last active August 11, 2016 18:35
Show Gist options
  • Save barek2k2/1c82af5c3fbb125ae27abc548295bcb2 to your computer and use it in GitHub Desktop.
Save barek2k2/1c82af5c3fbb125ae27abc548295bcb2 to your computer and use it in GitHub Desktop.
1. Login to AWS and launch Windows Server Machine from AWS EC2 console
Make sure you added Inbound rules(HTTP on 80 port and RDP on 3389 ) for this instance. RDP port will be used to remote login
into this instance via Remote Desktop Connection(an AWS tool available for Windows and Mac)
2. Once the windows Machine is ready, from your Windows Server's Firewell, open port 80
3. Install IIS(8.5). Its pretty straightforward. You can follow microsoft website about the instruction. Basically we will use IIS
for http reverse proxy server for the Ruby On Rails application.
4. Now ARR(Application Request Routing) needs to be installed for the IIS. You can install it from Microsoft Web Platform Installer 5.0
https://www.microsoft.com/web/downloads/platform.aspx
After installing ARR, you will get URL Rewrite module inside IIS. For ARR and URL Rewrite, just follow this link
http://blogs.iis.net/owscott/creating-a-reverse-proxy-with-url-rewrite-for-iis
5. While you setup the reverse proxy server settings, just add Inbound Rule(in our case, we put 127.0.0.1:3000) and no need to add outbound rule.
127.0.0.1:3000 means we have our Rails app running on port 3000
6. Installing PostgreSQL on Windows Server. Its simple to install. just go to https://www.postgresql.org/download/windows/
and download PostgeSQL(9.5) and install it from the Installer found on the link. Make sure you use password for the
superuser(postgres) and this password will be used in your Rails app's database.yml file.
7. Setting up Ruby On Rails application
i. Download Ruby On Rails from http://railsinstaller.org/en Right now we used Ruby 2.2 package. Just in conventional way,
pressing few next buttons, it will be installed.
ii. Our app will be reside on C:\Sites folder. From this folder run `gem install bundler`, `gem install rails`,
`rails new app_name` one after another. (make sure you have gem 'coffee-script-source', '1.8.0' and gem 'pg' into your Gemfile)
iii. From the C:\Sites\app_name folder, run `bundle install`, `rake db:create`, `rake db:migrate`
iv. Finally run your Puma ruby application server using `rails s -b 0.0.0.0 -p 3000`
Sample Rails app's database.yml file
default: &default
adapter: postgresql
username: postgres
password: root
pool: 5
timeout: 5000
development:
<<: *default
database: blog_app_development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment