RE: Setting up a parallel test environment on the same machine as main server
I believe you need to have a virtual host in Tomcat for each one on Apache. I also believe that the name of the workers is irrelevant, as is the IP address over which they communicate -- as long as the servers are bound to the right address(es). All differentiation takes place on the host header only. The https part (having to use Ips) is unfamiliar to me (I have one site on my server running secure, and that works fine.) Someone else feel free to jump in here and correct me if I am wrong. Tim So, you should have two virtual hosts (by name) in both server.xml and httpd.conf. Not sure how to solve the https problem -- never tried to myself. This is where I get lost. I currently have two virtual hosts on apache pointing at the same virtual host on tomcat ALL with different names - so this doesn't square with what you are saying of there being a one to one mapping. This server is running linux, with two ethernet cards. On the WAN side (which is what you can see) my ISP allocated via dhcp a single IP address. That is the www.chandlerfamily.org.uk address. On the lan side, I can allocate multiple IP addresses to the card in a set of psuedo devices, so at the moment it has address 192.168.0.20 and 192.168.0.30, 31, 32 and 39. Each of these is given separate names such as roo.home, appserv.home, webmail.home money.home and test.home by a nameserver also running on that machine On apache I have a number of virtual hosts set up (but because of the https problem they MUST be differenciated by ip address). At the moment I have the virtual hosts www.chandlerfamily.org.uk and money.home directing traffic to tomcat on the host appserv.home (the home page you saw was being generated in a java application). I want to add a tomcat host to serve java applications to an apache virtual host running on test.home. If I understand you correctly you would advocate creating additional host elements of my server.xml file with names of www.chandlerfamily.org.uk and test.home (I presume I have to keep default host of appserv.home just so that tomcat knows which ip address to listen on). If I do that how do I pick up traffic to money.home? add another host statement with repeated contexts? -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting up a parallel test environment on the same machine as main server
1. Moving the JkMount directive inside a VirtualHost... will make it accesible from only that virtual host. So, you must repeat common ones, such as /jkmanager. I put the mappings (JkMount(s)) right in the virtual host definition(s) with no trouble at all. 2. The virtual host is determined by the http host header, not by the connector host name. This is true for both httpd and tomcat (and any other web server.) You can always install Apache httpd + Tomcat on a second machine (or on the same machine on a separate set of ports), if you are reluctant to try it on you production host. HTH, Tim -Original Message- From: Alan Chandler [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 3:50 AM To: users@tomcat.apache.org Subject: Re: Setting up a parallel test environment on the same machine as main server On Sunday 12 February 2006 17:07, Alan Chandler wrote: ... Unless anyone here can suggest a better way, I would like to move the JkMountFile directive from global scope to virtual host scope and have two separate files urimap files so that I can map different things dependent on which virtual host. However, since this is a live site I don't want to just conduct the simple experiment to see if will work, so I am asking here if this is OK. Is there really nobody on this list who can answer this simple question? ... However, I don't fully understand the relationship between service, engine and host stanza's in the server.xml file, and until I do, I am reluctant to muck about with it and potentially screw the currently working arrangement. Specifically, there was some conversation here about it best that if tomcat was running on the same box as the web server (which it is in my case) that it would be best to make the connection between apache2 and tomcat be via localhost. That being the case, how can I map the SAME servlet name but from a different virtual host (albeit ip based) on apache to DIFFERENT hosts on the same tomcat engine. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting up a parallel test environment on the same machine as main server
On Tuesday 14 February 2006 12:36, Tim Lucia wrote: 1. Moving the JkMount directive inside a VirtualHost... will make it accesible from only that virtual host. So, you must repeat common ones, such as /jkmanager. I put the mappings (JkMount(s)) right in the virtual host definition(s) with no trouble at all. Thanks - just what I needed confirmation on 2. The virtual host is determined by the http host header, not by the connector host name. This is true for both httpd and tomcat (and any other web server.) Not sure I understand what you are mean here by http host header, isn't that the name of the web site that I am accessing (ie as known by apache) rather than as known by a backend topcat At the moment, I have apache, with two virtual host names of home.chandlerfamily.org.uk (also known as www.chandlerfamily.org.uk) (ip address of my WAN) money.home (ip address of 192.168.0.32) based on ip addressing only (ie not named virtual hosts - because it also needs to support https where named virtual hosts are not supported) which all end up using tomcat services for parts of the web site (urls as defined in JkMountFile). It is all directed to a single tomcat host via a single worker.properties file with the following worker.list=tomcat worker.tomcat.type=ajp13 worker.tomcat.host=appserv.home worker.tomcat.port=8009 worker.tomcat.connect_timeout=10 and a single host on the server.xml line defined as appserv.home This appserv.home (ip address 192.168.0.31) is certainly currently getting all the traffic it should get from apache - but I don't see how that is related to the http host in the header. BUT ... Do you mean that if I had changed my workers thusly worker.list=production,test worker.production.host=prodserv.home worker.test.host=testserv.home ... for the other parameters but where both prodserv.home, and testserv.home had the SAME ip address (say 127.0.0.1 :-) ) AND i add an apache virtual host of test.home (ip address 192.168.0.39) That I can differenciate them in the server.xml file by having an engine running of localhost, but with two hosts with names of prodserv.home and testserv.home respectively, and that provided the JkMountFile was then moved into the correct apache virtual host context, then the same url could be mapped by one apache virtual host to worker production and the other apache virtual host could map to worker test. I could then have different versions of the same app running on production and test. You can always install Apache httpd + Tomcat on a second machine (or on the same machine on a separate set of ports), if you are reluctant to try it on you production host. HTH, Tim -Original Message- From: Alan Chandler [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 3:50 AM To: users@tomcat.apache.org Subject: Re: Setting up a parallel test environment on the same machine as main server On Sunday 12 February 2006 17:07, Alan Chandler wrote: ... Unless anyone here can suggest a better way, I would like to move the JkMountFile directive from global scope to virtual host scope and have two separate files urimap files so that I can map different things dependent on which virtual host. However, since this is a live site I don't want to just conduct the simple experiment to see if will work, so I am asking here if this is OK. Is there really nobody on this list who can answer this simple question? ... However, I don't fully understand the relationship between service, engine and host stanza's in the server.xml file, and until I do, I am reluctant to muck about with it and potentially screw the currently working arrangement. Specifically, there was some conversation here about it best that if tomcat was running on the same box as the web server (which it is in my case) that it would be best to make the connection between apache2 and tomcat be via localhost. That being the case, how can I map the SAME servlet name but from a different virtual host (albeit ip based) on apache to DIFFERENT hosts on the same tomcat engine. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting up a parallel test environment on the same machine as main server
On Tuesday 14 February 2006 12:36, Tim Lucia wrote: You can always install Apache httpd + Tomcat on a second machine (or on the same machine on a separate set of ports), if you are reluctant to try it on you production host. Of course in an ideal world I would - but this is my home, and I don't have any more spare machines. I am already testing on an independant machine first, but I want to essentially bring a new version gently into play - running off of a single database on my main server - just to prove that I can bring the application up in as close to production environment as possible in a test environment before switching it to live. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting up a parallel test environment on the same machine as main server
On Wednesday 15 February 2006 01:13, Tim Lucia wrote: The http host header is sent by the user-agent (browser) based on the address requested in the URL. This is how virtual hosts are differentiated. Tomcat supports a host container for virtual host differentiation, just like Apache does. You do not need to change the workers at all. Tomcat sees the same host header that Apache does. I.e., using Tamper Data and FireFox, I see Host=www.chandlerfamily.org.uk Yes - I get that part. When I request your web site. (Along with a photo of you, presumably, in a tie sunglasses ;-) You might also want to send just Apache for the server, rather then Yes its me (although they are my normal glasses that I wear all the time - they just have light sensitive lenses), taken at my daughters graduation from Southampton University in the summer 2004 :-) Server=Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.2b1 DAV/2 SVN/1.1.4 mod_jk/1.2.14 mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e mod-xslt/1.0.0rc1 As it is more secure. How to do this was recently discussed on this list. Low priority - but I'll look at it. So, you should have two virtual hosts (by name) in both server.xml and httpd.conf. Not sure how to solve the https problem -- never tried to myself. This is where I get lost. I currently have two virtual hosts on apache pointing at the same virtual host on tomcat ALL with different names - so this doesn't square with what you are saying of there being a one to one mapping. This server is running linux, with two ethernet cards. On the WAN side (which is what you can see) my ISP allocated via dhcp a single IP address. That is the www.chandlerfamily.org.uk address. On the lan side, I can allocate multiple IP addresses to the card in a set of psuedo devices, so at the moment it has address 192.168.0.20 and 192.168.0.30, 31, 32 and 39. Each of these is given separate names such as roo.home, appserv.home, webmail.home money.home and test.home by a nameserver also running on that machine On apache I have a number of virtual hosts set up (but because of the https problem they MUST be differenciated by ip address). At the moment I have the virtual hosts www.chandlerfamily.org.uk and money.home directing traffic to tomcat on the host appserv.home (the home page you saw was being generated in a java application). I want to add a tomcat host to serve java applications to an apache virtual host running on test.home. If I understand you correctly you would advocate creating additional host elements of my server.xml file with names of www.chandlerfamily.org.uk and test.home (I presume I have to keep default host of appserv.home just so that tomcat knows which ip address to listen on). If I do that how do I pick up traffic to money.home? add another host statement with repeated contexts? -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]