• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Resin with Apache

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does Resin have to reside on the same machine as Apache? The only docs I can find are setup to install with both on the same machine.
Is running them on 2 seperate machines a bad idea?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I have a question regarding getting Apache to forward requests to Resin.
I have everything set up. Both Apache and Resin are running. I configured the mod_caucho.co and the httpd.conf in apache is loading it.
I have a test.jsp file that is simply:
2 + 2 = <%= 2 + 2 %>
This file resides in /usr/local/apache/htdocs
Now, if I do the following:
http://localhost:8080/test.jsp
Everything works.
However, if I do:
http://localhost/test.jsp
The browser asks me what I want to do with the file, like I want to download it or something.
I changed the resin.conf so that the doc dir points to apache's htdocs folder.
Anything else??
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like an Apache configuration issue to me. Asking for a page from 8080 presumably goes direct to Resin. Have you told Apache to pass all requests for JSP files to Resin?
As an aside, what is Apache giving you that Resin's built-in web server doesn't? Although I have set up systems with Apache and Resin in the past, I've found that for Java and static files, the Resin web server is just as good. Do you need CGI, PHP or something as well?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You make a good point. I just assumed that Apache had a better http server than Resin to service static HTML pages.
However, any J2EE app that has the need for that many static HTML pages to be served probably has its own set of problems.
I probably won't worry about until I need to do it for whatever reason.
Thanks Frank.
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the documentation, you cannot run each virtual host in a seperate JVM without Apache. Is there an advantage to having each virtual host run in its own JVM?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Frank Carver:
Have you told Apache to pass all requests for JSP files to Resin?


I thought that Loading the caucho module took care of that. However, I compiled apache to allow module support, and when I try and do the AddModule after the LoadModule, I get an error in the httpd.conf file that implies that I don't have module support.
So who knows.
 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there an advantage to having each virtual host run in its own JVM?
Yes, if each virtual host is "owned" by a different customer. I used to do this so that I could allow users to restart a VM if something went wrong, without breaking everyone else's applications!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, if each virtual host is "owned" by a different customer. I used to do this so that I could allow users to restart a VM if something went wrong, without breaking everyone else's applications!
This is exactly my problem. I used Resin as standalone server without Apache, resulting in that each time a new customer arrived I had to edit "resin.conf". That resulted in that all current applications went down and where logged out.
I have now tryed to run Resin with multiple JVM:s together with Apache that takes care of the virtual hosts. I can now start and stop each application in Resin separatley and also start new applications in Resin without interrupting the other applications.
After adding a new webbapplication in Resin I adds a virtual host in Apache and restarts it.
This seems to work, but gets very unstable. I wonder if it has to do with the communication between Apache and Resin?
Sometimes I get the proper response from a webapplication and other times I gets the jsp code as response. The jsp code probably comes directly from Apache that maybe doesn't gets contact with Resin all times?
Does anyone know how to set up this correctly???
I have used Resin 3.0.4 and Apache 2.0.48.
This is my conf files:
I start a webapplication with following command:
/home/resin/bin/httpd.sh -conf /home/resin/conf/www.mydomain.com.conf -pid /home/resin/conf/www.mydomain.com.pid start

This is how the conf file for the webapp in Resin looks like:
<resin xmlns="http://caucho.com/ns/resin">
<resin:include href="common.conf"/>
<cluster>
<srun id="" host="127.0.0.1" port="6802" index="1"/>
</cluster>
<host id='www.mydomain.com'>
<web-app id='' document-directory='/home/myapps/mydomain'/>
</host>
</server>
</resin>

This is how the mapping in Apache looks like:
LoadModule caucho_module /usr/local/apache2/modules/mod_caucho.so
<IfModule mod_caucho.c>
ResinConfigServer localhost 6802
<Location /caucho-status>
SetHandler caucho-status
</Location>
</IfModule>
NameVirtualHost 192.168.0.1
<VirtualHost 192.168.0.1>
ServerName www.mydomain.com
ResinConfigServer 192.168.0.1 6802
DirectoryIndex index.jsp
DocumentRoot /home/myapps/mydomain
<Location /caucho-status>
SetHandler caucho-status
</Location>
</VirtualHost>
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic