How to make GlassFish web server use JRuby on Rails? - ruby-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.

Related

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.

Setting up Rails on Hostmonster

I'm able to run rails s through ssh successfully and see the app start up just as it does on my own machine but I'm unable to access the app from the web. The app is directly under the home folder and I have a symbolic link pointing from public_html to the public folder of my rails app, just as this tutorial explains. I even tried setting up a subdomain and every other step in the tutorial to no avail. Any help would be highly appreciated.
You need an application server like Phusion Passenger, Unicorn or puma to run a Ruby app in a production environment. Typically, you'll integrate the application server into a web server's (Apache, nginx) environment.
I don't know about your hoster, but if you have root access, then you can probably use any of these application servers.
The built-in server you start by running rails server is only meant for testing purposes on your local machine. It has not been made with security, performance, stability or any other production-environment criteria in mind.

ASP.NET MVC Deployment Referencing Development Environment

I am trying to deploy my ASP.NET MVC 3 application using Visual Studio 2010's "Publish Web" option (build/Publish App). This generates deployment/bin, deployment/scripts, deployment/views etc.
I loaded these resulting deployment files/folders to a web server running IIS 6. Afterwards, everything seemed to run just fine on this web server.
I then started to make new updates, just to my local environment. After doing that, the deployed version of the site stopped working. I looked at the stack trace and the web server seemed to be referencing controllers.cs from my local environment, as opposed to the dll's in the bin directory on the web server.
Is there something else I need to do before deployment to tell the web server to use it's own bin files as opposed to files on my development environment?
BTW both my development machine and the web server live on the same network.
Update:
Another thing that made me suspect that the web server was referencing my local dev environment was that when a new user tried to access the application she got an IOFileNotFoundException in regards to a reference to "Interop.ActiveDs.dll". The stack trace mentioned my_local_path/Interop.ActiveDs.dll. This file was in fact not on the web server so I added it and then her error went away. The Odd thing was that all other users before her did not recieve an error about this missing reference.

how to deploy ruby on rails application in xampp in windows xp?

I'm very new to Ruby environment ..
I want to run my Ruby on rails Application in apache in xampp on windows xp rather than WeBrick server which is in-built for ruby on rails...
I tried it by adding Virtual host in apache- http.conf file
When i run my application i'm able to see "Welcome Abroad"....
But when i click on "About your application’s environment"
it was showing error like the following
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
9/9/2011 10:47:31 AM
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
To deploy your app with apache you need to use phusion passenger http://www.modrails.com
There are plenty of how-to's around the web and the documentation is good enough to get the service running.
This means your Ruby on Rails server is NOT running.
You need to run your server first.
I made a batch file, start-server.bat which contains
d:
cd "D:\Ruby\Web\rails1"
"C:\RailsInstaller\Ruby1.9.3\bin\ruby.exe" script\rails server
then check the PORT number of the server that is running,
So since the port on the screenshot says 10524, you can run it on
http://localhost:10524/

Setting up Apache for Rails production

I am developing a Rails 3 application and I have installed Capistrano on the client side and Passenger with Apache 2 on the server side.
I make a deployment and the files are sent to a folder called u/apps/.
But when I visit the IP address I am currently using I only get to an empty folder, how do I configure Apache to look for my app in the current folder? So that I only need to visit my IP/domain to see my app?
I have done this using Rails 2.x but I think for Rails 3 also pretty much the same thing. For this you need to use Passenger and then configure Apache.
Following are some useful resources
http://www.modrails.com/install.html
http://railscasts.com/episodes/122-passenger-in-development
If you browse to your URL and you see an apache files/folders list that means that passenger is not triggered for that location...
Test your server environment by running a mongrel/thin in your application folder and see that your application runs correctly. After that, look at your Apache configuration (see Passenger docs).

Resources