How to Deploy rails application using apache2 and apache tomcat server - ruby-on-rails

Hi I am new to ruby on rails and I want to deploy my rails app using web server apache2 and application server tomcat and jruby.I have installed tomcat 8.0.36 and apache2.My application runs on tomcat server IP_ADDRESS:8080.
apache2 folders:
apache2.conf conf-enabled magic mods-enabled sites-available
conf-available envvars mods-available ports.conf sites-enabled
Please suggest me how to connect both these server and deploy.If my idea is wrong then suggest me what are the best way to deploy rails app.

You could deploy using this link
https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-apache-on-ubuntu-14-04

Related

Ruby on rails application in Windows Azure Virtual Machine

Hi i have created a ubuntu virtual machine in windows azure for deploying my rails application..
I have connected to my virtual machine through ssh and followed this procedure for deployment
<http://www.andrehonsberg.com/article/install-rvm-ubuntu-1204-linux-for-ruby-193>
<http://www.windowsazure.com/en-us/develop/ruby/tutorials/web-app-with-linux-vm/>
My deployment was completed successfully.
While starting my server by running rails s in my application i am able to see my application up and running in browser.
My issue is the server is stopped for every 10 minutes and again i have to connect to my server through ssh and need to give rails s..
i want a solution to run my application continously..
The problem is you haven't actually "deployed" anything. You just copied your rails app to a VM and ran rails s.
A production rails applications is not deployed in this fashion.
Consider using either nginx with unicorn or apache/nginx with passenger.

Deploy "WAR" with Tomcat issue

I am using:
Ubuntu 12.04
JRuby 1.7.2
Rails 3.2.12
Tomcat 7.0.26
I have successfully run my application using
rails server
command and work with my demo application on 127.0.0.1:3000 .
I have installed warble gem and using
warble
in my application directory generates .war file which I have deployed. Unfortunately, when I try to reach my application using 127.0.0.1:8080/depot/ I get the following error:
org.jruby.exceptions.RaiseException: (NameError) cannot load Java
class com.ibm.db2.jcc.DB2Driver at
org.jruby.javasupport.JavaClass.for_name(org/jruby/javasupport/JavaClass.java:1227)
...................
So, I believe the application is not able to find the specified driver but how I am supposed to deploy it?
Also, using Tomcat in this way, will be my application visible from remote PCs?
Have you installed the db2 database drivers into the Tomcat shared resources folder? Or are they deployed as part of the .war ?
The simple answer is no. 127.0.0.1 always routes to localhost; You would need to define a new virtualhost in the TomCat configuration in order to expose your application to the outside world.

Deploying Java war and Rails app to Apache in Amazon EC2

is it possible to deploy java app and rails app to same EC2 sever. I have a rails app that communicates a java app via AJAX so I need to deploy both to same server. Is there any way to do that or any resource to see how to?
I guess it is possible by using apache2 with tomcat and passenger. Is it true?
You can install two servers in diferent ports i.e. Apache HTTP on 80 and Apache Tomcat (or other) on 8080. Also you can use mod_jk if you want attend all your clients through Apache HTTP. MOD_JK enables to you to integrate Apache Tomcat and Apache HTTP.

Rails framework & Nginx web server

As we install rails it uses its own web server WEBrick. If i want to run ths application in Nginx server, then how to configure or set the Nginx web werver?
You should run your rails application in a production server such as mongrel_cluster or thin (I have used the former, and am currently switching to the latter). To put nginx in front of it, I would use the upstream and proxy_pass directives. I found a nice blog post comparing ways of running rails applications that shows their config for mongrel_cluster + nginx.
Passenger is also available for nginx, I've used that with Apache and it was very easy to set up.

Apache Tomcat and Ruby

We have Ruby Rails and Apache tomcat servers running on the samw windows server. When the App on Apache Tomcat is installed alone its working fine, but when the ruby app is installed, the Apace Tomcat App stops working. We need to have both the apps running on the same server. Please help. The application running on Tomcat is displaying the login screens and allowing the users the login. And then rest of the things are failing. The application running on Ruby is just fine as expected. Also, we installed Apace Tomcat and then Ruby on to this server. so there are a lot of chances that the Ruby took Tomcat's port. But how to figure out the overlap?
You probably have both trying to bind to port 80. Whatever server you're using for rails (passenger via nginx/apache http server, nginx+thin/mongrel, etc) is bound to port 80, then tomcat tries to do the same and can't.
If you're using nginx, I would configure tomcat to run on 8080 and reverse proxy http requests to tomcat based on the hostname of part of the url.
You can do this too with apache http server with mod_proxy.

Resources