![]() ![]() In the Apache config, we have two servers in our load balancer, so you’ll need to create one service with port 3000 as the argument and another with port 3001. Arguments should just include the port number. The startup directory should be your Github project directory. Set the path to be the path to your batch script. Installing a service named “startApp” in the NSSM GUI. Run “nssm install ” and the GUI should appear. Next, download NSSM (Non-Sucking Service Manager) and put it on your path. We will pass in the port number as an argument to the script. I could use Puma or another server, but again I did not want to deal with more installation issues. I used Thin to start up our server because it is installed by default with Bitnami. Installing the App as a Windows ServiceĬreate a batch script (*.bat) file to start up your Rails application. This also sets up far-future expiration headers for assets so your server isn’t hammered with constant requests. Replace the virtual host block with the following (replacing with the path to your installation and with the directory for your project). Open the nf for Bitnami (something like C:\ \apache2\conf\nf) and make sure the following modules are not commented out.Īfter that, edit nf (something like C:\ \apache2\conf\bitnami\nf). Nginx could work with a little bit of effort. Since Bitnami’s service manager already has Apache set up (at the time of this writing), we will use that as our server. Setting up Apache as a Reverse Proxyīitnami comes with both Apache and Nginx. Once the database is set up, you only need to update the database.yml to point to that database. I set up a PostgreSQL database on another server, so I won’t get into configuring the database. Once that is installed, clone your project into Bitnami’s projects directory so that it can be easily accessed from the command line.Īfter that, normal Ruby commands should work within the Bitnami cmd terminal, so you can use your usual commands to set up your project (bundle install, rake db:create, rake db:migrate, etc). It is a little annoying to go back and forth between the command line and Github for Windows, but it was easier than attempting to install OpenSSL. I chose to use Github for Windows to make it easier to talk to a Github repository. Next, you will need a way to download your project. ![]() It runs as administrator, sets up your path, and takes you directly to the Bitnami directory. Whenever you are executing commands, make sure to use the terminal window created by that shortcut. You should also have a new command line shortcut in your start menu that is called “Use Bitnami Ruby Stack”. Once that is done, you should have a new directory that contains all of the components that Bitnami installed. Install Bitnami and Set Up Your Projectįirst of all, go to the Bitnami Ruby stack page and download and run the local installer. Most of this is based off of this Stack Overflow answer with some minor changes. We’ll set up our production environment using Bitnami’s Ruby stack, which bundles Ruby, Apache, Postgres, and some gems that will get our production setup to work. Doing so is not straightforward and the resources are limited, but it is in fact possible. However, a lot has changed in the past 8 years and it is possible to get a production setup on Windows. These things are all great if you are setting up a development box, but what about production? RailsInstaller is used for development and the virtual machine approach doesn’t work if your system administrator is not familiar with Linux at all. Also, with the advent of virtual machines and Vagrant, it is really easy to get a Linux environment set up regardless of what operating system you’re on. Since then, we had some open source projects like RailsInstaller that make it really easy to set up a development environment on your machine. When I first started learning Ruby on Rails back in 2007, one thing was made clear: don’t even try setting it up on a Windows machine. ![]()
0 Comments
Leave a Reply. |