You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by "Marc D. Murray" <ma...@phronein.com> on 2005/05/17 09:08:13 UTC
lenya through mod_jk2 + mod_rewrite
I decided to experiment with lenya, mod_jk2, and apache2 after reading
that apache<->tomcat via mod_jk2 can be considerably faster using unix
sockets than rewriting/proxying over port 8080...
So I figured, since I'm going to be spending so much time in lenya,
how's about making it able to talk that way... So I set about
experimenting reading 3 different tutorials and the result.....
I'm sure that there are some things that might not work yet, but I'm
still testing...
This allows me to have my virtual domain www.virtual1.com/index.html
transparently deliver http://realserver/lenya/virtual1/live/index.html.
The communication between apache and tomcat after the rewrite is
achieved using mod_jk2.
In this case the realserver = class02 (too lazy to search/replace).
I came out with this configuration....
------------------
Base system: PIII500/256MB/20GB/
Ubuntu 5.04 "Hoary" - Linux 2.6.10-5-386 #1 Tue Apr 5 12:12:40 UTC 2005
i686 GNU/Linux
java -version
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode)
Lenya 1.2.3
Cocoon 2.1.7
Apache/2.0.53 (Ubuntu) mod_jk2/2.0.4 PHP/4.3.10-10ubuntu4
<file-snippet file="/etc/apache2/workers.properties">
... all the default stuff.
..... anything with jni commented out. start tomcat manually
...... add this to the end of the file
[uri:/lenya/*]
worker=ajp13:localhost:8009
</file-snippet>
this allows me to access lenya directly through apache port 80 at
http://class02/lenya instead of http://class02:8080/lenya
as I understand, this is through mod_jk2. I'm not too sure about the
configuration though, because my experience with it is about 9 hrs.
Apache complains about a worker directive being deprecated. Help :(?
Next, the httpd.conf section that uses mod_rewrite to send requests to
virtual.local/* to class02/lenya/virtual1/live/*
<file-snippet file="/etc/apache2/sites-available/my-virtual-site">
<VirtualHost *>
ServerName virtual1.local
ServerAdmin webmaster@virtual1.local
ServerAlias www.virtual1.local virtual1
DocumentRoot /home/virtual1/www/
ProxyRequests Off
RewriteEngine On
RewriteLog /var/log/apache2/virtual1.rewrite.log
RewriteLogLevel 0
<Location />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Location>
RewriteRule ^/virtual1/live/(.*)$ $1 [R]
RewriteRule ^/$ index.html [R]
RewriteRule ^/lenya/virtual1/live/(.*)$ $1 [R,L]
RewriteRule ^/lenya/virtual1/(.*)$
http://class02.phronein.local/lenya/virtual1/$1 [R,L]
RewriteRule ^/(.*)
http://class02.phronein.local/lenya/virtual1/live/$1 [P]
</VirtualHost>
</file-snippet>
Automagically, my relative links transfer seamlessly :). I still have to
make a couple changes to the XSLT to make the images and css directories
also appear to be hanging from a root void of the lenya url.
Corrections and/or comments please.
Regards,
Marc DM.
Re: lenya through mod_jk2 + mod_rewrite
Posted by "Mike M." <le...@mordent.com>.
> Automagically, my relative links transfer seamlessly :). I still have to make
a couple changes to the XSLT to make the images and css directories also appear
to be hanging from a root void of the lenya url.
> Corrections and/or comments please.
> Regards,
> Marc DM.
You may run into a problem with the scheduler not working, so you can't publish,
click the scheduler tab, etc. I think there was a fix mentioned on the list
awhile back. If you can't find it let me know. I can repost it. I think I
basically ended up having to fix something somewhere in the proxy java code (I
think I submitted a patch for this) and I also had to hardcode my server url in
a config file somewhere...
-Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: lenya through mod_jk2 + mod_rewrite
Posted by Michael Wechner <mi...@wyona.com>.
Gregor J. Rothfuss wrote:
> Michael Wechner wrote:
>
>> Have you also tried mod_jk 1? Because it seems that the development
>> of mod_jk2 has been stalled ...
>
>
> not stalled: http://httpd.apache.org/docs-2.1/mod/mod_proxy_ajp.html
I don't know if mod_proxy_ajp is the successor of mod_jk2, bu AFAIK mod_jk2
development has been stalled and I don't know how different the codebase
of the two of them is.
Michi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: lenya through mod_jk2 + mod_rewrite
Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Michael Wechner wrote:
> Have you also tried mod_jk 1? Because it seems that the development of
> mod_jk2 has been stalled ...
not stalled: http://httpd.apache.org/docs-2.1/mod/mod_proxy_ajp.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: lenya through mod_jk2 + mod_rewrite
Posted by Michael Wechner <mi...@wyona.com>.
Marc D. Murray wrote:
>
>
> Corrections and/or comments please.
very cool. It would be great if you could add your notes/findings to the
Wiki ;-)
Have you also tried mod_jk 1? Because it seems that the development of
mod_jk2 has been stalled ...
Thanks
Michi
>
> Regards,
>
> Marc DM.
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org