Tomcat 5.5, Apache 2.0.XX and mod_proxy
I'm trying to proxy my Tomcat web application through Apache 2.0 using mod_proxy. I have uncommented the following in my server.xml: !-- Define a Proxied HTTP/1.1 Connector on port 8082 -- !-- See proxy documentation for more information about using this. -- Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true / and I've added the following to my httpd.conf: VirtualHost *:80 ServerName foo.bar.com ProxyPass / http://foobar.com:8082/app/ ProxyPassReverse / http://foobar.com:8082/app/ /VirtualHost The pages are being passed without any problems but the sessions are being lost as cookies are not being passed. I'm guessing I need to add something to the above stanza which rewrite the cookies. But what? -- View this message in context: http://www.nabble.com/Tomcat-5.5%2C-Apache-2.0.XX-and-mod_proxy-tf4881521.html#a13970134 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, Apache 2.0.XX and mod_proxy
Thats because your configuration is incomplete, in order for Apache to pass the cookie to the correct context you need to do some additional configuration (or alternatively use a connector like mod_jk) You may need to configure the jvmRoute parameter in server.xml, this allows Apache to map to the correct Tomcat context, otherwise deploy your web app in the Tomcat root context. Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true jvmRoute=T1/ You also need to add a server mapping in Apache, one way to do this easily is with a RewriteMap. (If you use Apache 2.2 then you could use the in-built mod_proxy_balancer module). I also use Apache 2.0 so I just make a static mapping, which looks something like this: RewriteMap SERVERS rnd:/etc/apache2/servers.conf -- servers.conf -- T1 tomcat.server.com:8081 ALL tomcat.server.com:8081 #configure more instances for load balancing if you wish Peter mip wrote: I'm trying to proxy my Tomcat web application through Apache 2.0 using mod_proxy. I have uncommented the following in my server.xml: !-- Define a Proxied HTTP/1.1 Connector on port 8082 -- !-- See proxy documentation for more information about using this. -- Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true / and I've added the following to my httpd.conf: VirtualHost *:80 ServerName foo.bar.com ProxyPass / http://foobar.com:8082/app/ ProxyPassReverse / http://foobar.com:8082/app/ /VirtualHost The pages are being passed without any problems but the sessions are being lost as cookies are not being passed. I'm guessing I need to add something to the above stanza which rewrite the cookies. But what?
Re: Tomcat 5.5, Apache 2.0.XX and mod_proxy
It is just the port your Tomcat is running on, which could be any port, so if you are using 8082 that will be your port... it's better though not to be on port 80. mip wrote: Thanks Peter. Should that be: -- servers.conf -- T1 tomcat.server.com:8082 ALL tomcat.server.com:8082 ? If not what is port 8081 being used for? Peter Stavrinides wrote: Thats because your configuration is incomplete, in order for Apache to pass the cookie to the correct context you need to do some additional configuration (or alternatively use a connector like mod_jk) You may need to configure the jvmRoute parameter in server.xml, this allows Apache to map to the correct Tomcat context, otherwise deploy your web app in the Tomcat root context. Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true jvmRoute=T1/ You also need to add a server mapping in Apache, one way to do this easily is with a RewriteMap. (If you use Apache 2.2 then you could use the in-built mod_proxy_balancer module). I also use Apache 2.0 so I just make a static mapping, which looks something like this: RewriteMap SERVERS rnd:/etc/apache2/servers.conf -- servers.conf -- T1 tomcat.server.com:8081 ALL tomcat.server.com:8081 #configure more instances for load balancing if you wish Peter mip wrote: I'm trying to proxy my Tomcat web application through Apache 2.0 using mod_proxy. I have uncommented the following in my server.xml: !-- Define a Proxied HTTP/1.1 Connector on port 8082 -- !-- See proxy documentation for more information about using this. -- Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true / and I've added the following to my httpd.conf: VirtualHost *:80 ServerName foo.bar.com ProxyPass / http://foobar.com:8082/app/ ProxyPassReverse / http://foobar.com:8082/app/ /VirtualHost The pages are being passed without any problems but the sessions are being lost as cookies are not being passed. I'm guessing I need to add something to the above stanza which rewrite the cookies. But what? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, Apache 2.0.XX and mod_proxy
Thanks Peter. Should that be: -- servers.conf -- T1 tomcat.server.com:8082 ALL tomcat.server.com:8082 ? If not what is port 8081 being used for? Peter Stavrinides wrote: Thats because your configuration is incomplete, in order for Apache to pass the cookie to the correct context you need to do some additional configuration (or alternatively use a connector like mod_jk) You may need to configure the jvmRoute parameter in server.xml, this allows Apache to map to the correct Tomcat context, otherwise deploy your web app in the Tomcat root context. Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true jvmRoute=T1/ You also need to add a server mapping in Apache, one way to do this easily is with a RewriteMap. (If you use Apache 2.2 then you could use the in-built mod_proxy_balancer module). I also use Apache 2.0 so I just make a static mapping, which looks something like this: RewriteMap SERVERS rnd:/etc/apache2/servers.conf -- servers.conf -- T1 tomcat.server.com:8081 ALL tomcat.server.com:8081 #configure more instances for load balancing if you wish Peter mip wrote: I'm trying to proxy my Tomcat web application through Apache 2.0 using mod_proxy. I have uncommented the following in my server.xml: !-- Define a Proxied HTTP/1.1 Connector on port 8082 -- !-- See proxy documentation for more information about using this. -- Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true / and I've added the following to my httpd.conf: VirtualHost *:80 ServerName foo.bar.com ProxyPass / http://foobar.com:8082/app/ ProxyPassReverse / http://foobar.com:8082/app/ /VirtualHost The pages are being passed without any problems but the sessions are being lost as cookies are not being passed. I'm guessing I need to add something to the above stanza which rewrite the cookies. But what? -- View this message in context: http://www.nabble.com/Tomcat-5.5%2C-Apache-2.0.XX-and-mod_proxy-tf4881521.html#a13971776 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, Apache 2.0.XX and mod_proxy
-- T1 tomcat.server.com:8081 ALL tomcat.server.com:8081 #configure more instances for load balancing if you wish Peter mip wrote: I'm trying to proxy my Tomcat web application through Apache 2.0 using mod_proxy. I have uncommented the following in my server.xml: !-- Define a Proxied HTTP/1.1 Connector on port 8082 -- !-- See proxy documentation for more information about using this. -- Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true / and I've added the following to my httpd.conf: VirtualHost *:80 ServerName foo.bar.com ProxyPass / http://foobar.com:8082/app/ ProxyPassReverse / http://foobar.com:8082/app/ /VirtualHost The pages are being passed without any problems but the sessions are being lost as cookies are not being passed. I'm guessing I need to add something to the above stanza which rewrite the cookies. But what? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Tomcat-5.5%2C-Apache-2.0.XX-and-mod_proxy-tf4881521.html#a13972723 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]