Upayavira,
on my standalone version of tomcat I set the docBase="cocoon". Apache2 was connected to tomcat via mod_jk2. So tomcat now becomes:

http://www.mysite.com:8080/cocoon

Setting my http.conf file with the following settings:

RewriteEngine on

RewriteRule (.*)\.xml$ beyarecords/$1.xml [P]
RewriteRule (.*)\.xsl$ beyarecords/$1.xsl [P]
RewriteRule (.*)\.kont$ beyarecords/$1.kont [P]
RewriteRule (.*)\.jx$ beyarecords/$1.jx [P]
RewriteRule (.*)\.xsp$ beyarecords/$1.xsp [P]
RewriteRule (.*)\.css$ beyarecords/$1.css [P]
RewriteRule (.*)\.js$ beyarecords/$1.js [P]
RewriteRule (.*)\.mp3$ beyarecords/$1.mp3 [P]
RewriteRule (.*)\.m3u$ beyarecords/$1.m3u [P]
RewriteRule (.*)\.jpg$ beyarecords/$1.jpg [P]

Then enabled me to do the following:

http://www.mysite.com/filename.xml

and everything worked fine. Filenames that were not defined with a rewrite rule were searched for on Apache. With my current Jboss setup this is not the case. With the Jboss out of the box the docBase is ROOT.war for which if you enter:

http://www.mysite.com:8080/index.html

the actual folder structure to access index.html is:

/server/default/deploy/jbossweb-tomcat50.sar/root.war/index.html

So if I change the docBase to point away from root.war to cocoon.war, will this not then allow me to do what i need to do? how do I change the docbase of jboss-tomcat50.sar from root.war to cocoon.war?

many thanks


Andrew


On 2 Nov 2004, at 06:43, Upayavira wrote:

beyaNet wrote:

Upayavira,
thanks for your reply. I'm not sure I quitefollow you as this whole Apache RewriteRule business is new to me. Could you possible give me an example of what you mean?

Sorry for the delay. I missed your message.

Take this:

user goes to www.yoursite.com:80/hello.html
this redirects to www.yoursite.com:8080/cocoon/hello.html

When generating this page, Cocoon creates a session. When the servlet container creates a session, it will create it relative to the server and the _path_, i.e. www.yoursite.com and /cocoon. This is passed back to Apache, which returns a page to them with the url www.yoursite.com:80/hello.html, and a cookie for the path /cocoon.

When they then click on the link to www.yoursite.com:80/another.html, the browser says to itself, "Do I have any cookies for this path?", to which the answer is 'no', as the /cocoon cookie isn't relevant. But it should have been. It is your session cookie. Hence, when generating the another.html page, Cocoon will create a new session for it.

The solution is to have Apache and Cocoon/servlet container use the same directory nesting, e.g:

http://www.yoursite.com:80/hello.html --> http://www.yoursite.com:8080/hello.html

That's it really.

Now say you want to have:

http://www.myfirstsite.com:80/hello.html -> http://www.myfirstsite.com:8080/first/hello.html
http://www.mysecondsite.com:80/hello.html -> http://www.mysecondsite.com:8080/second/hello.html

You should switch that to:

http://www.myfirstsite.com:80/hello.html -> http://www.myfirstsite.com:8080/hello.html
http://www.mysecondsite.com:80/hello.html -> http://www.mysecondsite.com:8080/hello.html

and have either your servlet container mount different webapps based upon the hostname, or have Cocoon use the HostMatcher to mount different sitemaps based upon hostname.

Make sense now?

Regards, Upayavira



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


<<inline: beya-email.gif>>


�+The home of urban music
+ http://www.beyarecords.com

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

Reply via email to