Running more than one Grails application on Amazon's EC2 - grails

Can I run more than one Grails application on a virtual Linux machine in Amazon's cloud? I start one application on port 8080 and the other on say port 8090? Basically, I am trying to run two versions of the same application, one that testers can use to test and the other on which I can continue development. I seem to be able to launch the second application but I cannot get to it with my browser. The way I am doing it now is launching the first application by grails run-war and the development version with grails run-app of course. I can get to my first application by doing www.hostname.com:8080 but the one on www.hostname.com:8090 is not available in the browser.

Related

How to deploy a Ruby on Rails app to AWS-EC2 Ubuntu Linux using Apache 2?

We want to configure Apache to work with a Rails app. We want Apache to do load control. We cannot get them to work together. We are using MySQL for the database. If we could please have some type of instruction or tutorial to follow to be able to deploy our application in AWS-EC2, it will be greatly appreciated.
We have a domain and we want to have multiple Rails app running in the same domain. Each rails app seems to want to run in a different port. We do not want to expose port 80/443. Apache is managing the inbound request. My attempts to use the host file has not been successful.

Is one rails server per application?

I have two questions about rails server:
Do I have to start the server from within the application folder?
Is the server I started only for that application?
If they are true, this does not quite make sense to me, since why do I need to start multiple servers?
Or is there some kind of master configuration, so that one server can route to different applications? Is Capistrano for this purpose?
I'm going to assume you're talking about the rails server command, for running a local rails server to test your application, and that you're not talking about setting up a rails application on a remote server. Please mention if that is not the case.
Yes, you must execute rails server from within the root folder of your rails application.
Yes, the server you started is only for that application. It's a self-contained thing.
You should not need to start multiple servers. Even if you have multiple applications, you probably don't need to have more than one running at a time. So, you can shut down the rails server in one application (Ctrl-C) and then cd to your new application, and start a new rails server there with rails server.
If you do need to run two local rails applications at once, you can do so by running them on different ports. So, the first one, you can just execute rails server and it will make your site available at localhost:3000 (because port 3000 is the default port). The next one, you can specify a port other than 3000 - eg. rails server -p 3001 to get a rails app at localhost:3001.
Capistrano is for deploying your applications to a remote server, not for running them locally on your own computer. So, it is not relevant here. What you may be interested in is http://pow.cx/
Again, I've assumed you're talking about running your rails app locally on your own computer. If you're referring to deploying it to the internet on a server, then you can ignore this answer.

How to solve cross domain errors when running two grails apps on localhost

I am trying to run-app my project with other wars/wars also running. So for example we have a war/ear that has legacy web services that I would like to access. My goal is to deploy those existing wars/ears with my run-app. I can deploy both separately, as grails run-app on port 8081 and jboss on port 8080. The problem was when I tried to do a ajax POST, DELETE, or PUT I get a cross-domain error because each app is on its own port. Is there a way to use run-app so that my grails project is at localhost:8080/grails and the webservices are at localhost:8080/webservices
Env: Grails 2.1.1
Server: Jboss (perfered) or vFabric tc Server (by dropping in existing war/war)
I don't believe that you can "run-app" both projects on the same port because you're running an embedded container. However, what you can do is check out the Grails CORS plugin which will allow other domains to access your grails app during run-app or otherwise.
http://grails.org/plugin/cors

How to make GlassFish web server use JRuby on Rails?

I installed Ubuntu, GlassFish web server, installed JRuby on Rails using GlassFish's admin tools, deployed my application from .war archive. The problem is only - when I attempt to run this web application nothing happens. GlassFish isn't listening on port 8080 as promised. The GlassFish administration web console listens on port 4848 and works fine. What to do to pair GlassFish and JRuby on Rails the correct way, remembering that it isn't a separate JRuby installation?
Update: it seems that this problem lies somewhere around access rights because I can deploy an application through
sudo ./asadmin deploy
but can not do the same through web console. The output is as if the application has been deployed, without any error messages (web interface shows the presence of application, domain folder contains my application's file/folder structure), but something in server's internals isn't bound to application.
I didn't think much and applied quick and dirty solution: set "777" access rights to /home/glassfish and all its contents. It helped.

How to publish a JSP Webpage created with Netbeans?

I want to allow others to access my website created through Netbeans but I don't know how to do so. Ive searched and I found that you had to buy webservers and domain names?
However, I only want to host the webpage using my own computer since it isn't really anything commercial. How can I publish the webpage using Netbeans or my own computer? Would using IIS of Windows be possible?
Thanks!
You can download or use (if you have installed) Apache-Tomcat to deploy your web-app on your local machine.
Text from the above mentioned link.
It is possible to deploy web applications to a running Tomcat server.
If the Host autoDeploy attribute is "true", the Host will attempt to
deploy and update web applications dynamically, as needed, for example
if a new .WAR is dropped into the appBase. For this to work, the Host
needs to have background processing enabled which is the default
configuration.

Resources