Re: Basic Usage / Hosting Questions

2003-06-01 Thread Jeremy Quinn
On Friday, May 30, 2003, at 03:39 PM, JD Daniels wrote:

So question one: Am I better off from a server resource standpoint, to 
have
ONE installation of Cocoon, and point the appBase to a subdirectory of 
it?



A popular way of running several cocoon-based projects as separate 
virtual hosts, is to use one instance of Cocoon, serving each project 
via a sub-sitemap, using virtualhost and mod_proxy in Apache HTTPD to 
point to each one.

See: http://wiki.cocoondev.org/Wiki.jsp?page=ApacheModProxy

The downside of this may be when your Clients all want different 
component declarations, like their own datasources, input-modules, 
lucene indexes, etc.

Here is an example from one of my Apache httpd configs:

# If mod_proxy cannot connect to the servlet container, we want
# to display a nice static page saying the reason. This is a
# SHTML page (using the Server-Side-Includes filter)
ErrorDocument 502 /errors/service-unavailable.shtml
ErrorDocument 500 /errors/server-error.shtml
ErrorDocument 404 /errors/document-unavailable.shtml
ProxyPreserveHost On
ProxyErrorOverride On
NameVirtualHost *

VirtualHost *
ServerName www.foo.org
# eg. get Apache to serve directly out of a Cocoon project
# Serve foo.org's CSS
Alias /style/ /Library/TomCat/webapps/cocoon/foo/parts/css/
Directory /Library/TomCat/webapps/cocoon/foo/parts/css
  Options Indexes MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all
/Directory
# don't proxy any request beginning with the following keywords:
ProxyPass/errors/ !
ProxyPass/style/ !
# send everything else to the foo sub-sitemap
ProxyPass/ http://localhost:8080/cocoon/foo/
ProxyPassReverse / http://localhost:8080/cocoon/foo/
/VirtualHost

VirtualHost *
ServerName www.bar.org
# eg. a custom log file for bar.org
CustomLog logs/bar_log common
# don't proxy any request beginning with the following keywords:
ProxyPass/errors/ !
# eg. serve the Cocoon distribution
ProxyPass/cocoon/ http://localhost:8080/cocoon/
ProxyPassReverse /cocoon/ http://localhost:8080/cocoon/
# send everything else to the bar sub-sitemap
ProxyPass/ http://localhost:8080/cocoon/bar/
ProxyPassReverse / http://localhost:8080/cocoon/bar/
/VirtualHost

In order for Apache to be able to over-ride Cocoon's error pages, you 
need to modify Cocoon's error handling like below, to send out the 
appropriate HTTP Response code.

map:handle-errors
  map:select type=exception
map:when test=not-found
  map:generate type=notifying/
  map:transform src=stylesheets/system/error2html.xslt
map:parameter name=contextPath 
value={request:contextPath}/
map:parameter name=pageTitle value=Resource not found/
  /map:transform
  map:serialize status-code=404/
/map:when
map:otherwise
  map:generate type=notifying/
  map:transform src=stylesheets/system/error2html.xslt
map:parameter name=contextPath 
value={request:contextPath}/
  /map:transform
  map:serialize status-code=500/
/map:otherwise
  /map:select
/map:handle-errors

Hope this helps

regards Jeremy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Basic Usage / Hosting Questions

2003-05-31 Thread JD Daniels
Hey everyone,

Among Other things, I am an ISP, and have put together two machines to get
all my perl/php crap working under cocoon. I have this outstanding trouble,
but really really want to make a production machine for multuple domain
hosting.

So I have the following questions:

What would be the best way to setup a cocoon server for multiple users?

Right now I have one machine with tomcat 4.18 and virtual host containers
  Host name=www.domain.com debug=0 appBase=hosts/domain
unpackWARs=true autoDeploy=true
Aliasdomain.com/Alias
Alias64.114.x.x/Alias
  /Host

  Host name=www.someotherdomain.com debug=0
appBase=hosts/someotherdomain unpackWARs=true autoDeploy=true
Aliassomeotherdomain.com/Alias
Alias64.114.x.x/Alias
  /Host

So question one: Am I better off from a server resource standpoint, to have
ONE installation of Cocoon, and point the appBase to a subdirectory of it?
Right now, I have one machine with 4 hosts on it, all running thier own
complete copies of cocoon. To this point, I have only been using some of the
functionality while I figure out the basics enough to be able to handle
support calls. My numero-uno problem is this:

In Cocoon error and access logs :
ERROR   (2003-05-28) 14:09.30:185   [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Cocoon got an Exception while trying to close
stream.
java.io.IOException: The stream has been closed

Or:
ERROR   (2003-05-29) 18:09.07:920   [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Cocoon got an Exception while trying to close
stream.
java.net.SocketException: Broken pipe

Just seems to happen randomly. Although reliably.
So then after about 8 of those babies I get this in catalina.out
Logging Error: Unknown error writing event.
java.lang.OutOfMemoryError

And well, then nothing works
(However, my career started by trial and error perl/php hacking, and I
simply do not understand java memory management / garbage collecting...
yet )

This looks like a Tomcat trouble, But I can't figure it out :(

Help?
Ideas? :)

JD


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]