Reputation: 2135
This question has not been asked since Rail 3.0 came out (or I cannot find it):
How to run Rails 3+ application on Apache on Windows (WAMP)? Is Mongrel the best option? Sounds not optimal to me to have Apache as a proxy and then another server. Passenger does not exist on Windows.
What I hope to get from your is a link to a magical installation package and a snippet from the httpd.conf file that would divert one to a rails application.
Upvotes: 3
Views: 8285
Reputation: 1653
I realize this is very old question, but I've just found a very easy solution which doesn't involve installing any new software. It only requires a few more flags in httpd.conf. It's detailed in this article on editrocket.com:
http://editrocket.com/articles/ruby_apache_windows.html
Upvotes: 0
Reputation: 50057
The advantage of using apache (or nginx) as a proxy is that it can load-balance between different mongrel (or thin) instances. So you would have to start three mongrel instances (services) and configure apache to proxy those.
Configuring apache to different mongrel processes is pretty straightforward, can be found all over the internet. Here is an example of a httpd-vhosts.conf
(replace yourapplication
by your actual application/domain and root-folder):
<VirtualHost *:80>
#ServerName 10.200.65.35
#ServerAlias 10.200.65.35
ServerName yourapplication.com
DocumentRoot d:/yourapplication/current/
<Directory c:/yourapplication/current/public/ >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# On active les proxy qui sont par défaut désactivés
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
<Proxy balancer://mongrel_cluster>
BalancerMember http://127.0.0.1:4000
BalancerMember http://127.0.0.1:4001
BalancerMember http://127.0.0.1:4002
</Proxy>
ProxyPass / Balancer://mongrel_cluster/
ProxyPassReverse / balancer://mongrel_cluster/
#ProxyReserveHost on
#log files
ErrorLog "/Program Files/Apache Software Foundation/Apache2.2/logs/yourapplication_error.log"
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog "/Program Files/Apache Software Foundation/Apache2.2/logs/yourapplication_access.log" combined
#Rewrite stuff
RewriteEngine On
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
</VirtualHost>
Another, very promising alternative to deploy on windows is using TorqueBox. TorqueBox is JBoss/Jruby based solution, and thus platform independent. In benchmarks it is shown that TorqueBox performs incredibly well, and actually anybody should seriously consider switching to it.
Hope this helps.
Upvotes: 2
Reputation: 125
How about InstantRails have you tried it? http://rubyforge.org/projects/instantrails/
Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all pre-configured and ready to run. No installer, you simply drop it into the directory of your choice and run it. It does not modify your system environment.
What about trying a virtual machine like Vagrant: http://vagrantup.com/docs/getting-started/index.html
Or perhaps JRubyStack.
As far as I know, the only way to deploy rails in windows is using apache + mongrel. Good luck!
Upvotes: 0