Run RhoConnect On Two Different Ports

47 sec read

RhoConnect uses Thin Ruby server, so the simple way to run it on two different ports is

bundle exec thin start -e development -p 9294
bundle exec thin start -e development -p 9293

Now you can access RhoConnect from http://localhost:9294 and http://localhost:9293
If you want to have the detach option then you can try

bundle exec dtach -A /tmp/rhoconnect.dtach rackup -s thin -p 9393 config.ru -P /tmp/rhoconnect.pid

Make sure you use different pid for the second instance.
Now, you may want each of your RhoConnect to use different instances of Redis server running locally. First check the site
http://chrislaskey.com/blog/342/running-multiple-redis-instances-on-the-same-server/ on how to run multiple instance of Redis server and then point it from your RhoConnect (/settings/settings.yml)
If you are interested in digging further, the you can check the rake tasks at your local RhoConnect Gem installation /gems/rhoconnect-3.1.1/lib/rhoconnect/tasks.rb
[source language=”ruby”]
desc “Start rhoconnect server”
task :start => :dtach_installed do
cmd = (jruby?) ? trinidad? : (thin? || mongrel? || report_missing_server)
if windows?
puts ‘Starting rhoconnect…’
system(“#{cmd} config.ru -P #{rhoconnect_pid}”)
elsif jruby?
puts ‘Starting rhoconnect in jruby environment…’
system(“#{cmd}”)
else
puts ‘Detach with Ctrl+\ Re-attach with rake rhoconnect:attach’
sleep 2
sh “dtach -A #{rhoconnect_socket} #{cmd} config.ru -P #{rhoconnect_pid}”
end
end
[/source]

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *