Page 1 of 1

Apache ProxyPass and Tomcat proxyPort proxyName

Posted: Thu Feb 03, 2005 12:47 am
by joaquindromero
I am trying to use my Apache server on another box to proxy Scalix web access on my scalix server. I currently have Apache set up to proxy and in fact am doing it for another site I host.

I have Apache Configured in the following way:
<VirtualHost *:80>
ServerName server.com
ServerAlias thedomainiwant.com
ProxyPass / http://localscalixserver:8080/webmail/
ProxyPassReverse / http://localscalixserver:8080/webmail/
</VirtualHost>

Finally,I have Tomcat setup as such:

<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8080"
proxyName="thedomainiwant.com"
proxyPort="80"/>

When I access my site I get the Scalix login but I get errors like this:
Object Expected
Object doesnt support this property or method

I have read up on what to do with Tomcat so it will serve out correctly through an Apache proxy but no luck.

I have changed the conf and xml files so much I probably created a small error that is screwing me up but... can someone please help?

Is there anyone out there proxying through Apache to their SWA?

Thanks

Posted: Thu Feb 03, 2005 5:33 am
by ScalixSupport
We use mod_jk2. You can get a binary from http://apache.intissite.com/jakarta/tomcat-connectors/jk2/binaries/linux/. There are currently only binaries for FC1,SuSE 9.0 and SLES but the FC1 version definitely works on FC2.

You should make the following modifications to your Apache config:

1) Add a file $APACHE_HOME/conf/workers2.properties with the following contents:

Code: Select all

# Define the communication channel (default AJP13 Tomcat port is 8009)
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
tomcatId=localhost:8009

# Map the Tomcat URI to the Web Server URI space
[uri:/webmail/*]
info=Map the SWA app

[uri:/sac/*]
info=Map the SAC app

[uri:/caa/*]
info=Map the link between SAC and Ubermanager


Obviously you will need to change localhost to be the name of your SWA server.

2) Add a file $APACHE_HOME/conf.d/webmail.conf with the following contents:

Code: Select all

LoadModule jk2_module modules/mod_jk2.so

<Location />
  AddOutputFilterByType DEFLATE text/xml text/html text/css
  AddOutputFilterByType DEFLATE application/x-javascript
</Location>


Note: The <Location> stanza is probably not needed if you don't require compression on your data stream.

3) Copy mod_jk2.so to $APACHE_HOME/modules and make sure that the permissions are:

Code: Select all

-rwxr-xr-x  1 root root


4) Restart your Apache server.

Cheers

Dave.

Posted: Thu Jul 14, 2005 12:23 pm
by axsom1
How would you go about adding SSL capabilities to this configuration?

I'm having a hard time finding anything out there that talks about Apache + Tomcat + SSL.

Any help would be greatly appreciated.

Thanks,
John

Posted: Thu Jul 14, 2005 3:30 pm
by axsom1
Nevermind the SSL through apache stuff. I ended up dumping mod_jk2 and going with mod_jk.

Thanks,
John

Posted: Thu Jul 14, 2005 7:00 pm
by ScalixSupport
axsom1 wrote:Nevermind the SSL through apache stuff. I ended up dumping mod_jk2 and going with mod_jk.


Can I ask why ?

Cheers

Dave

Posted: Thu Jul 14, 2005 7:45 pm
by axsom1
Well it just seemed easier to setup. I found more documentation for mod_jk also, but just adding JkMount /webmail/* webmail to a virtual host seemed easier for me.

I'm sure there are better ways to do this, which I'm all open for suggestions.

I guess I could just add a rewrite rule in apache for the webmail space... :idea:

Anyhoot, the whole thing started with trying to secure just the one section of an external site to allow remote users to login to their mail from home.

John

Posted: Mon Jul 18, 2005 2:59 am
by Valerion
ScalixSupport wrote:
axsom1 wrote:Nevermind the SSL through apache stuff. I ended up dumping mod_jk2 and going with mod_jk.


Can I ask why ?


I have been playing with inegrating mod_jk and mod_jk2 on my server too. My main concern is future support and coding from the Jakarta project.

http://jakarta.apache.org/site/downloads/downloads_tomcat-connectors.cgi lists mod_jk2 as deprecated, and both http://apache.is.co.za/dist/jakarta/tomcat-connectors/ and http://apache.is.co.za/dist/jakarta/tomcat-connectors/jk2/ lists it as unsupported since November 2004, recommending mod_jk for this purpose.