Tomcat SSL and Virtual Domains
We are running tomcat 4 standalone. I have things running fine with one host but now we need to add two more virtual hosts. I am pretty sure the problem is with my server.xml file but I haven't been able to figure it out. I have read through the docs and looked through the postings and I'm still stuck. Can someone help me out here? Please? Here's the file: Server is running and the sterling domain is fine. Just the others that have problems. Thank you in advance D Blaine Server port=8005 shutdown=SHUTDOWN debug=0 Service name=Tomcat-Standalone Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8080 minProcessors=5 maxProcessors=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true / !-- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8009 minProcessors=5 maxProcessors=75 enableLookups=false redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=false acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory keystoreFile=/home/svhrs-1/keystore.kdb clientAuth=false protocol=TLS/ /Connector !-- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=false acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory keystoreFile=/home/kinres/ssl2/keystore1.kdb keystorePass=kinseth clientAuth=false protocol=TLS/ /Connector -- Engine name=Standalone defaultHost=sterling-vizcaya-hotel-reservations-sacramento.com debug=0 Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/ Host appBase=/home/svhrs-1/sterling-vizcaya-hotel-reservations-sacramento-www/webapps unpackWARs=true autoDeploy=true debug=0 name=sterling-vizcaya-hotel-reservations-sacramento.com Valve className=org.apache.catalina.valves.AccessLogValve pattern=common prefix=access-log directory=/home/svhrs-1/sterling-vizcaya-hotel-reservations-sacramento-logs / Context path=/home/svhrs-1/sterling-vizcaya-hotel-reservations-sacramento-www/webapps/hotel docBase=hotel privileged=true debug=0 Manager className=org.apache.catalina.session.PersistentManager debug=0 saveOnRestart=true maxActiveSessions=-1 minIdleSwap=-1 maxIdleSwap=-1 maxIdleBackup=-1 Store className=org.apache.catalina.session.FileStore/ /Manager Environment name=maxExemptions type=java.lang.Integer value=15/ /Context /Host Host appBase=/home/kinres/esavvy-reservations-www/webapps unpackWARs=true autoDeploy=true debug=0 name=esavvy-reservations.com Valve className=org.apache.catalina.valves.AccessLogValve pattern=common prefix=access-log directory=/home/kinres/esavvy-reservations-logs / Context path=/home/kinres/esavvy-reservations-www/webapps/esavvyres docBase=esavvyres privileged=true debug=0 Manager className=org.apache.catalina.session.PersistentManager debug=0 saveOnRestart=true maxActiveSessions=-1 minIdleSwap=-1 maxIdleSwap=-1 maxIdleBackup=-1 Store className=org.apache.catalina.session.FileStore/ /Manager Environment name=maxExemptions type=java.lang.Integer value=15/ /Context /Host Host appBase=/home/esavvy/esavvysystems-www/webapps unpackWARs=true autoDeploy=true debug=0 name=esavvysystems.com Valve className=org.apache.catalina.valves.AccessLogValve pattern=common prefix=access-log directory=/home/esavvy/esavvysystems-logs / Context path=/home/esavvy/esavvysystems-www/webapps/esavvyres docBase=esavvyres privileged=true debug=0 Manager className=org.apache.catalina.session.PersistentManager debug=0 saveOnRestart=true maxActiveSessions=-1 minIdleSwap=-1 maxIdleSwap=-1 maxIdleBackup=-1 Store className=org.apache.catalina.session.FileStore/ /Manager Environment name=maxExemptions type=java.lang.Integer value=15/ /Context /Host -- /Engine /Service /Server
Re: Tomcat SSL and Virtual Domains
I had a similar issue. I too had a doubt in servr.xml. Search the archives for the topic Virtual Hosting with WAR files. I've posted in detail what the configurations that helped me with virtual hosting. Hope it helps you too Regards Thanks Mahesh S Kudva -Original Message- From: Dawn Blaine [EMAIL PROTECTED] To: Dawn Blaine [EMAIL PROTECTED] Cc: tomcat-user@jakarta.apache.org Date: Sat, 03 Sep 2005 11:45:12 -0500 Subject: Tomcat SSL and Virtual Domains We are running tomcat 4 standalone. I have things running fine with one host but now we need to add two more virtual hosts. I am pretty sure the problem is with my server.xml file but I haven't been able to figure it out. I have read through the docs and looked through the postings and I'm still stuck. Can someone help me out here? Please? Here's the file: Server is running and the sterling domain is fine. Just the others that have problems. Thank you in advance D Blaine Server port=8005 shutdown=SHUTDOWN debug=0 Service name=Tomcat-Standalone Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8080 minProcessors=5 maxProcessors=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true / !-- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8009 minProcessors=5 maxProcessors=75 enableLookups=false redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=false acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory keystoreFile=/home/svhrs-1/keystore.kdb clientAuth=false protocol=TLS/ /Connector !-- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=false acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory keystoreFile=/home/kinres/ssl2/keystore1.kdb keystorePass=kinseth clientAuth=false protocol=TLS/ /Connector -- Engine name=Standalone defaultHost=sterling-vizcaya-hotel-reservations-sacramento.com debug=0 Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/ Host appBase=/home/svhrs-1/sterling-vizcaya-hotel-reservations-sacramento-w ww/webapps unpackWARs=true autoDeploy=true debug=0 name=sterling-vizcaya-hotel-reservations-sacramento.com Valve className=org.apache.catalina.valves.AccessLogValve pattern=common prefix=access-log directory=/home/svhrs-1/sterling-vizcaya-hotel-reservations-sacramento -logs / Context path=/home/svhrs-1/sterling-vizcaya-hotel-reservations-sacramento-www/ webapps/hotel docBase=hotel privileged=true debug=0 Manager className=org.apache.catalina.session.PersistentManager debug=0 saveOnRestart=true maxActiveSessions=-1 minIdleSwap=-1 maxIdleSwap=-1 maxIdleBackup=-1 Store className=org.apache.catalina.session.FileStore/ /Manager Environment name=maxExemptions type=java.lang.Integer value=15/ /Context /Host Host appBase=/home/kinres/esavvy-reservations-www/webapps unpackWARs=true autoDeploy=true debug=0 name=esavvy-reservations.com Valve className=org.apache.catalina.valves.AccessLogValve pattern=common prefix=access-log directory=/home/kinres/esavvy-reservations-logs / Context path=/home/kinres/esavvy-reservations-www/webapps/esavvyres docBase=esavvyres privileged=true debug=0 Manager className=org.apache.catalina.session.PersistentManager debug=0 saveOnRestart=true maxActiveSessions=-1 minIdleSwap=-1 maxIdleSwap=-1 maxIdleBackup=-1 Store className=org.apache.catalina.session.FileStore/ /Manager Environment name=maxExemptions type=java.lang.Integer value=15/ /Context /Host Host appBase=/home/esavvy/esavvysystems-www/webapps unpackWARs=true autoDeploy=true debug=0 name=esavvysystems.com Valve className=org.apache.catalina.valves.AccessLogValve pattern=common prefix=access-log
Virtual domains
Recently I asked whether Tomcat can be used w/o Apache, and the answers that I received convinced me that for my project using Tomcat by itself is the right thing to do. But does Tomcat support virtual domains? Aaron Fude __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains
Yes. Check the documentation. On Mon, 24 Jan 2005 12:40:19 -0800 (PST), Dola Woolfe [EMAIL PROTECTED] wrote: Recently I asked whether Tomcat can be used w/o Apache, and the answers that I received convinced me that for my project using Tomcat by itself is the right thing to do. But does Tomcat support virtual domains? Aaron Fude __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains
Dola Woolfe wrote: But does Tomcat support virtual domains? The FM, particularly the Server Configuration Reference, is your friend :-) http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/index.html :: which would lead you to the Host element... http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains
The FM, particularly the Server Configuration Reference, is your friend :-) Wrong! Guys like you, who point me to the FM, are my friends. Thanks for the response. Aaron __ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Virtual Domains -- almost
OK, I have Apache and Tomcat working together -- mostly. URL's go to teh right places but now one of the jsp's gives me the following error. This worked when I didn't use virtual domains but had a separate copy of tomcat running as a standalone server for each domain on the machine. That is not practical anymore so I am trying to get the virtual domains working. Apache 1.3.22 Tomcat 4.1.24 Redhat 7.2 error report - HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: javax/jms/JMSException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:536) root cause javax.servlet.ServletException: javax/jms/JMSException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536) at org.apache.jsp.ProdList_jsp._jspService(ProdList_jsp.java:1499) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256
Virtual Domains with Tomcat
Right now I am running multiple domains with Tomcat by having a completely separate instances attached to a different virtual interface: eth0, eth0:1, etc. This works OK for two or even three domains but it will be getting unwieldy as the number of domains increases. Is there anyway to do virtual named domains with Tomcat? This is dirt simple to do in Apache but the web developers only know how to program in Java and Visual Basic so I'm kind of stuck with Tomcat. I've tried using mod_jk but only the Apache side works, Tomcat still goes to the same directories for its files no mater what domian the request is for. -- Stephen Carville UNIX and Network Administrator DPSI (formerly Ace USA Flood Services) 310-342-3602 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Virtual domains with Tomcat
How can I get Tomcat to recognize virtual domains? This is trivial with Apache and I can get Apache to fetch the correct jsp but I cannot get timcat to process it. If I turn off tomcat, apache sends the jsp source. If I turn tomcat on, I get the error 404 page workers.properties: workers.tomcat_home-/var/jakarta/tomcat workers.java_home=/usr/java/jdk ps=/ # worker list worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 jk.conf: (Included by the httpd.conf file) LoadModule jk_module modules/mod_jk.so JkWorkersFile /etc/httpd/conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log example Virtual Host VirtualHost * ServerName dookoo.totalflood.com DocumentRoot/var/jakarta/totalflood/ROOT Directory /var/jakarta/totalflood/ROOT order allow,deny allow from all /Directory DirectoryIndex HomePage.jsp ErrorLog/var/log/httpd/totalflood-error.log JkMount /*.jsp ajp13 /VirtualHost -- Stephen Carville UNIX and Network Administrator DPSI (formerly Ace USA Flood Services) 310-342-3602 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains with Tomcat
How can I get Tomcat to recognize virtual domains? This is trivial with Apache and I can get Apache to fetch the correct jsp but I cannot get timcat to process it. If I turn off tomcat, apache sends the jsp source. If I turn tomcat on, I get the error 404 page Anything in the logs? I'm not totally sure, but I think you need to match VHosts in your Apache and your Tomcat. I'll be testing exactly that today with mod_jk2, Apache 2.0.46 and Tomcat 4.1.24. For mod_webapp it is definite - you need: Service ... Connector ... Engine ... Host name=my-vhost.domain.com ... Context docBase=... path=../ /Host /Service I think the same applies to all other connectors: mod_jk, mod_jk2 and HTTP. Nix.
Re: Virtual domains with Tomcat
It is trivial in Tomcat as well. For each Apache ServerName, you will need a corresponding Host entry in Tomcat's server.xml. Make sure each virtual host in Tomcat's server.xml has its own appBase. For the VirtualHost you posted: Host name=dookoo.totalflood.com appBase=/var/jakarta/totalflood Context path= docBase=ROOT / /Host ...or something very similar. Put your JSPs in /var/jakarta/totalflood/ROOT. Make sure there is a directory called /var/jakarta/totalflood/ROOT/WEB-INF. Delete your Directory entry that allows all, and instead add a Directory entry that restricts WEB-INF and META-INF. This is all covered in the docs for Host and for Context. An example of what configuration for Apache looks like, for a virtual host named localhost, is here: http://www.johnturner.com/howto/mod_jk_conf.html John On Fri, 20 Jun 2003 18:21:20 -0700, Stephen Carville [EMAIL PROTECTED] wrote: How can I get Tomcat to recognize virtual domains? This is trivial with Apache and I can get Apache to fetch the correct jsp but I cannot get timcat to process it. If I turn off tomcat, apache sends the jsp source. If I turn tomcat on, I get the error 404 page workers.properties: workers.tomcat_home-/var/jakarta/tomcat workers.java_home=/usr/java/jdk ps=/ # worker list worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 jk.conf: (Included by the httpd.conf file) LoadModule jk_module modules/mod_jk.so JkWorkersFile /etc/httpd/conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log example Virtual Host VirtualHost * ServerName dookoo.totalflood.com DocumentRoot/var/jakarta/totalflood/ROOT Directory /var/jakarta/totalflood/ROOT order allow,deny allow from all /Directory DirectoryIndex HomePage.jsp ErrorLog/var/log/httpd/totalflood-error.log JkMount /*.jsp ajp13 /VirtualHost -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains with Tomcat
Yes. In general, for every Apache ServerName, you need a corresponding Host entry in Tomcat's server.xml. The Apache connectors are just pipelines, they do not do any work on behalf of Tomcat. Thus, when Tomcat receives the request, it has to do the same sort of host header processing that Apache has to do. If Tomcat cannot find a Host entry that corresponds to the HTTP Host Header it is receiving on the request, it will default to the host name listed in the defaultHost parameter in server.xml. Apache does the same thing...if it can't find a VirtualHost to match the host header, it defaults to the global VirtualHost, or rather the global ServerName. The syntax for defining a virtual host in Tomcat's server.xml is different than Apache's httpd.conf, but the principles and concepts are the same. John On Mon, 23 Jun 2003 11:00:58 +0200, Nikola Milutinovic [EMAIL PROTECTED] wrote: How can I get Tomcat to recognize virtual domains? This is trivial with Apache and I can get Apache to fetch the correct jsp but I cannot get timcat to process it. If I turn off tomcat, apache sends the jsp source. If I turn tomcat on, I get the error 404 page Anything in the logs? I'm not totally sure, but I think you need to match VHosts in your Apache and your Tomcat. I'll be testing exactly that today with mod_jk2, Apache 2.0.46 and Tomcat 4.1.24. For mod_webapp it is definite - you need: Service ... Connector ... Engine ... Host name=my-vhost.domain.com ... Context docBase=... path=../ /Host /Service I think the same applies to all other connectors: mod_jk, mod_jk2 and HTTP. Nix. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains with Tomcat
When you use virtual hosts on apache2 with mod_jk2 does Tomcat have to have the same virtual hosts defined in it's server.xml file? --Rick Anderson John Turner wrote: Yes. In general, for every Apache ServerName, you need a corresponding Host entry in Tomcat's server.xml. The Apache connectors are just pipelines, they do not do any work on behalf of Tomcat. Thus, when Tomcat receives the request, it has to do the same sort of host header processing that Apache has to do. If Tomcat cannot find a Host entry that corresponds to the HTTP Host Header it is receiving on the request, it will default to the host name listed in the defaultHost parameter in server.xml. Apache does the same thing...if it can't find a VirtualHost to match the host header, it defaults to the global VirtualHost, or rather the global ServerName. The syntax for defining a virtual host in Tomcat's server.xml is different than Apache's httpd.conf, but the principles and concepts are the same. John On Mon, 23 Jun 2003 11:00:58 +0200, Nikola Milutinovic [EMAIL PROTECTED] wrote: How can I get Tomcat to recognize virtual domains? This is trivial with Apache and I can get Apache to fetch the correct jsp but I cannot get timcat to process it. If I turn off tomcat, apache sends the jsp source. If I turn tomcat on, I get the error 404 page Anything in the logs? I'm not totally sure, but I think you need to match VHosts in your Apache and your Tomcat. I'll be testing exactly that today with mod_jk2, Apache 2.0.46 and Tomcat 4.1.24. For mod_webapp it is definite - you need: Service ... Connector ... Engine ... Host name=my-vhost.domain.com ... Context docBase=... path=../ /Host /Service I think the same applies to all other connectors: mod_jk, mod_jk2 and HTTP. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains with Tomcat
Yes, AFAIK. As I understand it, the JK/JK2 connectors are pipelines, not pre-or post- processors. They send the request from Apache to Tomcat. When Tomcat receives the request, it is as if Apache doesn't even exist. Tomcat acts the same way it would act if using Tomcat stand-alone. I could be wrong, but I've never been able to successfully setup a virtual hosting configuration without defining my virtual hosts in both Apache's httpd.conf and Tomcat's server.xml. If there's a shortcut, I'd love to see it. John On Mon, 23 Jun 2003 10:59:33 -0400, Rick Anderson [EMAIL PROTECTED] wrote: When you use virtual hosts on apache2 with mod_jk2 does Tomcat have to have the same virtual hosts defined in it's server.xml file? --Rick Anderson John Turner wrote: Yes. In general, for every Apache ServerName, you need a corresponding Host entry in Tomcat's server.xml. The Apache connectors are just pipelines, they do not do any work on behalf of Tomcat. Thus, when Tomcat receives the request, it has to do the same sort of host header processing that Apache has to do. If Tomcat cannot find a Host entry that corresponds to the HTTP Host Header it is receiving on the request, it will default to the host name listed in the defaultHost parameter in server.xml. Apache does the same thing...if it can't find a VirtualHost to match the host header, it defaults to the global VirtualHost, or rather the global ServerName. The syntax for defining a virtual host in Tomcat's server.xml is different than Apache's httpd.conf, but the principles and concepts are the same. John On Mon, 23 Jun 2003 11:00:58 +0200, Nikola Milutinovic [EMAIL PROTECTED] wrote: How can I get Tomcat to recognize virtual domains? This is trivial with Apache and I can get Apache to fetch the correct jsp but I cannot get timcat to process it. If I turn off tomcat, apache sends the jsp source. If I turn tomcat on, I get the error 404 page Anything in the logs? I'm not totally sure, but I think you need to match VHosts in your Apache and your Tomcat. I'll be testing exactly that today with mod_jk2, Apache 2.0.46 and Tomcat 4.1.24. For mod_webapp it is definite - you need: Service ... Connector ... Engine ... Host name=my-vhost.domain.com ... Context docBase=... path=../ /Host /Service I think the same applies to all other connectors: mod_jk, mod_jk2 and HTTP. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual domains with Tomcat
On Monday June 23 2003 05:45 am, John Turner wrote: It is trivial in Tomcat as well. For each Apache ServerName, you will need a corresponding Host entry in Tomcat's server.xml. Make sure each virtual host in Tomcat's server.xml has its own appBase. For the VirtualHost you posted: Host name=dookoo.totalflood.com appBase=/var/jakarta/totalflood Context path= docBase=ROOT / /Host That works. Thanks. I had to remove the Context ... / -- It caused tomcat fail. Howewer, it seems it is not necessary. ...or something very similar. Put your JSPs in /var/jakarta/totalflood/ROOT. Make sure there is a directory called /var/jakarta/totalflood/ROOT/WEB-INF. Delete your Directory entry that allows all, and instead add a Directory entry that restricts WEB-INF and META-INF. This is all covered in the docs for Host and for Context. An example of what configuration for Apache looks like, for a virtual host named localhost, is here: http://www.johnturner.com/howto/mod_jk_conf.html John On Fri, 20 Jun 2003 18:21:20 -0700, Stephen Carville [EMAIL PROTECTED] wrote: How can I get Tomcat to recognize virtual domains? This is trivial with Apache and I can get Apache to fetch the correct jsp but I cannot get timcat to process it. If I turn off tomcat, apache sends the jsp source. If I turn tomcat on, I get the error 404 page workers.properties: workers.tomcat_home-/var/jakarta/tomcat workers.java_home=/usr/java/jdk ps=/ # worker list worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 jk.conf: (Included by the httpd.conf file) LoadModule jk_module modules/mod_jk.so JkWorkersFile /etc/httpd/conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log example Virtual Host VirtualHost * ServerName dookoo.totalflood.com DocumentRoot/var/jakarta/totalflood/ROOT Directory /var/jakarta/totalflood/ROOT order allow,deny allow from all /Directory DirectoryIndex HomePage.jsp ErrorLog/var/log/httpd/totalflood-error.log JkMount /*.jsp ajp13 /VirtualHost -- Stephen Carville http://www.heronforge.net/~stephen/gnupgkey.txt -- Mom Pop were just a couple of kids when they got married. He was eighteen, she was sixteen and I was three. -- Billie Holiday - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
webapps/host0/index.html . On Mon, 16 Dec 2002 18:46:28 -0500, Turner, John wrote: I'm sorry, what's wrong isn't exactly clear from your post. What should http://host0.com show besides the default welcome page? John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 4:27 PM To: Tomcat Users List Subject: Virtual Domains with Tomcat 4.1.12 Standalone I haven't seen this question answered yet: I'm trying to set up virtual domains with Tomcat 4.1.12. ( Not running Apache ) I have modified my server.xml file as follows. webapps/host0 contains a basic index.html . What might I be doing wrong? (http://host0.com shows the default index.jsp. ) Is there a way to see the information that Tomcat receives when http://host0.com is requested? ( thanks ) !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- !-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
You want index.html to show instead of index.jsp? My tongue-in-cheek response is rename index.html to index.jsp. Another response would be check the welcome file element in web.xml for your webapp. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 8:21 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone webapps/host0/index.html . On Mon, 16 Dec 2002 18:46:28 -0500, Turner, John wrote: I'm sorry, what's wrong isn't exactly clear from your post. What should http://host0.com show besides the default welcome page? John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 4:27 PM To: Tomcat Users List Subject: Virtual Domains with Tomcat 4.1.12 Standalone I haven't seen this question answered yet: I'm trying to set up virtual domains with Tomcat 4.1.12. ( Not running Apache ) I have modified my server.xml file as follows. webapps/host0 contains a basic index.html . What might I be doing wrong? (http://host0.com shows the default index.jsp. ) Is there a way to see the information that Tomcat receives when http://host0.com is requested? ( thanks ) !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- !-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Hmm. I think the answer to your question is no -- I am trying to get a very basic version of virtual domains working. I noted in the past that renaming index.jsp to index.notjsp and putting an index.html file in the /ROOT directory resulted in tomcat loading index.html. So... I'm trying to load index.html in a directory where no index.jsp exists. ( Should have the same result: [webapps/host0/]index.html should be loaded, assuming that Tomcat process the virtual host as I want it to. ) BTW: If I want a .jsp to be loaded instead of an .htm or .html (default behavior?) if both exist in the directory, Do I need that step with the web.xml file? On Tue, 17 Dec 2002 08:28:11 -0500, Turner, John wrote: You want index.html to show instead of index.jsp? My tongue-in-cheek response is rename index.html to index.jsp. Another response would be check the welcome file element in web.xml for your webapp. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 8:21 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone webapps/host0/index.html . On Mon, 16 Dec 2002 18:46:28 -0500, Turner, John wrote: I'm sorry, what's wrong isn't exactly clear from your post. What should http://host0.com show besides the default welcome page? John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 4:27 PM To: Tomcat Users List Subject: Virtual Domains with Tomcat 4.1.12 Standalone I haven't seen this question answered yet: I'm trying to set up virtual domains with Tomcat 4.1.12. ( Not running Apache ) I have modified my server.xml file as follows. webapps/host0 contains a basic index.html . What might I be doing wrong? (http://host0.com shows the default index.jsp. ) Is there a way to see the information that Tomcat receives when http://host0.com is requested? ( thanks ) !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- !-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:03 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hmm. I think the answer to your question is no -- I am trying to get a very basic version of virtual domains working. I noted in the past that renaming index.jsp to index.notjsp and putting an index.html file in the /ROOT directory resulted in tomcat loading index.html. So... I'm trying to load index.html in a directory where no index.jsp exists. ( Should have the same result: [webapps/host0/]index.html should be loaded, assuming that Tomcat process the virtual host as I want it to. ) BTW: If I want a .jsp to be loaded instead of an .htm or .html (default behavior?) if both exist in the directory, Do I need that step with the web.xml file? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:03 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hmm. I think the answer to your question is no -- I am trying to get a very basic version of virtual domains working. I noted in the past that renaming index.jsp to index.notjsp and putting an index.html file in the /ROOT directory resulted in tomcat loading index.html. So... I'm trying to load index.html in a directory where no index.jsp exists. ( Should have the same result: [webapps/host0/]index.html should be loaded, assuming that Tomcat process the virtual host as I want it to. ) BTW: If I want a .jsp to be loaded instead of an .htm or .html (default behavior?) if both exist in the directory, Do I need that step with the web.xml file? -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
check out conf/web.xml and its welcome-file-list. there you can set the order of welcome pages to load.(index,jsp first, then index.html, etc) Charlie -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:03 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hmm. I think the answer to your question is no -- I am trying to get a very basic version of virtual domains working. I noted in the past that renaming index.jsp to index.notjsp and putting an index.html file in the /ROOT directory resulted in tomcat loading index.html. So... I'm trying to load index.html in a directory where no index.jsp exists. ( Should have the same result: [webapps/host0/]index.html should be loaded, assuming that Tomcat process the virtual host as I want it to. ) BTW: If I want a .jsp to be loaded instead of an .htm or .html (default behavior?) if both exist in the directory, Do I need that step with the web.xml file? On Tue, 17 Dec 2002 08:28:11 -0500, Turner, John wrote: You want index.html to show instead of index.jsp? My tongue-in-cheek response is rename index.html to index.jsp. Another response would be check the welcome file element in web.xml for your webapp. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 8:21 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone webapps/host0/index.html . On Mon, 16 Dec 2002 18:46:28 -0500, Turner, John wrote: I'm sorry, what's wrong isn't exactly clear from your post. What should http://host0.com show besides the default welcome page? John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 4:27 PM To: Tomcat Users List Subject: Virtual Domains with Tomcat 4.1.12 Standalone I haven't seen this question answered yet: I'm trying to set up virtual domains with Tomcat 4.1.12. ( Not running Apache ) I have modified my server.xml file as follows. webapps/host0 contains a basic index.html . What might I be doing wrong? (http://host0.com shows the default index.jsp. ) Is there a way to see the information that Tomcat receives when http://host0.com is requested? ( thanks ) !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- !-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
I *don't* want to change that order. On Tue, 17 Dec 2002 09:55:06 -0500, Cox, Charlie wrote: check out conf/web.xml and its welcome-file-list. there you can set the order of welcome pages to load.(index,jsp first, then index.html, etc) Charlie -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:03 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hmm. I think the answer to your question is no -- I am trying to get a very basic version of virtual domains working. I noted in the past that renaming index.jsp to index.notjsp and putting an index.html file in the /ROOT directory resulted in tomcat loading index.html. So... I'm trying to load index.html in a directory where no index.jsp exists. ( Should have the same result: [webapps/host0/]index.html should be loaded, assuming that Tomcat process the virtual host as I want it to. ) BTW: If I want a .jsp to be loaded instead of an .htm or .html (default behavior?) if both exist in the directory, Do I need that step with the web.xml file? On Tue, 17 Dec 2002 08:28:11 -0500, Turner, John wrote: You want index.html to show instead of index.jsp? My tongue-in- cheek response is rename index.html to index.jsp. Another response would be check the welcome file element in web.xml for your webapp. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 8:21 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone webapps/host0/index.html . On Mon, 16 Dec 2002 18:46:28 -0500, Turner, John wrote: I'm sorry, what's wrong isn't exactly clear from your post. What should http://host0.com show besides the default welcome page? John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 4:27 PM To: Tomcat Users List Subject: Virtual Domains with Tomcat 4.1.12 Standalone I haven't seen this question answered yet: I'm trying to set up virtual domains with Tomcat 4.1.12. ( Not running Apache ) I have modified my server.xml file as follows. webapps/host0 contains a basic index.html . What might I be doing wrong? (http://host0.com shows the default index.jsp. ) Is there a way to see the information that Tomcat receives when http://host0.com is requested? ( thanks ) !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- !-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.419 / Virus Database: 235 - Release Date: 11/13/2002 -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED
RE: Virtual Domains with Tomcat 4.1.12 Standalone
No, you want defaultHost to be localhost, or some other name. defaultHost has nothing to do with virtual hosts. One Engine can have multiple Hosts, each Host can have multiple Contexts. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:22 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Virtual Domains with Tomcat 4.1.12 Standalone
No, it is not. Leave defaultHost alone. Setup a Host element for host0.com and host1.com. If this is not working, either post your entire server.xml or post log file snippets with error messages. XML files are sensitive to properly closed tags and elements...including just a small snippet of your server.xml file doesn't let anyone verify that you've positioned and closed the new tags correctly because we can't see any of the other tags. My apologies, but this is starting to get fairly tedious. Adding a new Host element is a trivial exercise, all you have to do is make sure you position it correctly and close it correctly. There's really nothing else to do. If you have to, copy server.xml to server-work.xml, delete all of the comments and other extra information, and work with the resulting smaller file until you get the new elements closed and positioned correctly. Server.xml is no different than and HTML file...position and close everything properly, and it works. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Changing defaultHost is not the solution. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:51 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts (one is localhost, the other is some.server.com), and the welcome files display correctly. If it isn't working for you, I would suggest that the issue is with your virtual hosting configuration, not your welcome file/index.html configuration. John -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail
RE: Virtual Domains with Tomcat 4.1.12 Standalone
If I leave the defaultHost to localhost and have a host name=something.com, when I type in the url http://something.com/{webapp}/index.jsp, I get a server not found or DNS error. Do I need to define something.com anywhere else in win2000 Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:04 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Changing defaultHost is not the solution. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:51 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have a RH 7.3 test box setup, with two virtual hosts
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Got it, John. Thanks for your time. ( not being sarcastic... forgot to thank you earlier. ) ( For the record, I only posted the small snippet because that was all that I changed from out of the box ) I'll try to verify the XML tags now. ( I've thought about this before, but I'll look at it again. ) I thought that maybe I had something screwy going on with part of the request being blocked, but I honestly don't know that part intimately enough to look at it and verify that everything is coming through ok. On Tue, 17 Dec 2002 11:03:06 -0500, Turner, John wrote: No, it is not. Leave defaultHost alone. Setup a Host element for host0.com and host1.com. If this is not working, either post your entire server.xml or post log file snippets with error messages. XML files are sensitive to properly closed tags and elements...including just a small snippet of your server.xml file doesn't let anyone verify that you've positioned and closed the new tags correctly because we can't see any of the other tags. My apologies, but this is starting to get fairly tedious. Adding a new Host element is a trivial exercise, all you have to do is make sure you position it correctly and close it correctly. There's really nothing else to do. If you have to, copy server.xml to server-work.xml, delete all of the comments and other extra information, and work with the resulting smaller file until you get the new elements closed and positioned correctly. Server.xml is no different than and HTML file...position and close everything properly, and it works. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Hari: My guess is that something.com would need to have a DNS record in a nameserver ( that resolves to the box that you have Tomcat on. ) On Tue, 17 Dec 2002 11:09:30 -0500, Hari Venkatesan wrote: If I leave the defaultHost to localhost and have a host name=something.com, when I type in the url http://something.com/{webapp}/index.jsp, I get a server not found or DNS error. Do I need to define something.com anywhere else in win2000 Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:04 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Changing defaultHost is not the solution. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:51 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone That sounds almost exactly like what I'm trying to do. Does your test box setup also have Apache installed? If not, what did you do to get some.server.com showing up? On Tue, 17 Dec 2002 09:14:08 -0500, Turner, John wrote: Sorry, maybe someone else can answer your question. I'm just not understanding the problem. I have
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Let's put it this way. If you had to change defaultHost for virtual hosts to work, then you could never have more than one virtual host, since there is only one defaultHost. That's obviously wrong. Tomcat has the ability to serve many virtual hosts, not just one. I have several virtual hosts running on a Sun 420R at the moment, and there's only one defaultHost (and it's set to localhost). If you are getting server not found then something.com doesn't resolve to an IP address. Can you ping something.com? If not, there's your answer. If something.com resolved to the IP address where Tomcat was running, and there was no virtual host defined, then Tomcat would revert to serving the default context from the default host. That's what defaultHost does. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:10 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone If I leave the defaultHost to localhost and have a host name=something.com, when I type in the url http://something.com/{webapp}/index.jsp, I get a server not found or DNS error. Do I need to define something.com anywhere else in win2000 Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:04 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Changing defaultHost is not the solution. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:51 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Exactly. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:16 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: My guess is that something.com would need to have a DNS record in a nameserver ( that resolves to the box that you have Tomcat on. ) On Tue, 17 Dec 2002 11:09:30 -0500, Hari Venkatesan wrote: If I leave the defaultHost to localhost and have a host name=something.com, when I type in the url http://something.com/{webapp}/index.jsp, I get a server not found or DNS error. Do I need to define something.com anywhere else in win2000 Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:04 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Changing defaultHost is not the solution. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:51 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what you need from that. The Host element for localhost has a lot of stuff in it, probably stuff you don't need. Just delete most of it, and you should be fine. Alternatively, find the localhost Host element in server.xml and change the name parameter from localhost to your.server.com, restart Tomcat, and test it out and see if the behavior is what you want, then just copy that. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:20 AM To: Tomcat Users List
RE: Virtual Domains with Tomcat 4.1.12 Standalone
If you post your server.xml, someone will look at it. I can't promise I will, as time is everything, but someone will. If you could remove the comments from it and post an uncommented version, that would make it smaller and easier to scan. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:12 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Got it, John. Thanks for your time. ( not being sarcastic... forgot to thank you earlier. ) ( For the record, I only posted the small snippet because that was all that I changed from out of the box ) I'll try to verify the XML tags now. ( I've thought about this before, but I'll look at it again. ) I thought that maybe I had something screwy going on with part of the request being blocked, but I honestly don't know that part intimately enough to look at it and verify that everything is coming through ok. On Tue, 17 Dec 2002 11:03:06 -0500, Turner, John wrote: No, it is not. Leave defaultHost alone. Setup a Host element for host0.com and host1.com. If this is not working, either post your entire server.xml or post log file snippets with error messages. XML files are sensitive to properly closed tags and elements...including just a small snippet of your server.xml file doesn't let anyone verify that you've positioned and closed the new tags correctly because we can't see any of the other tags. My apologies, but this is starting to get fairly tedious. Adding a new Host element is a trivial exercise, all you have to do is make sure you position it correctly and close it correctly. There's really nothing else to do. If you have to, copy server.xml to server-work.xml, delete all of the comments and other extra information, and work with the resulting smaller file until you get the new elements closed and positioned correctly. Server.xml is no different than and HTML file...position and close everything properly, and it works. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already in it. The default server.xml file has a single virtual host (localhost) with a three Contexts (admin, manager, examples). Copy what
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Thanks for the reply john. I got it. But there is one small problem yet to resolve. When I use http://something.com/{Webapp}/index.jsp, it comes back with a Basic Server Authentication window. I don't have any authentication setup in web.xml file. I am using IIS and tomcat and have defined virtualhost in server.xml file. If I access the server directly by it name, it is showing me the index page but if try with the virtualhost, I get authentication for the server. Any ideas? Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:19 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Let's put it this way. If you had to change defaultHost for virtual hosts to work, then you could never have more than one virtual host, since there is only one defaultHost. That's obviously wrong. Tomcat has the ability to serve many virtual hosts, not just one. I have several virtual hosts running on a Sun 420R at the moment, and there's only one defaultHost (and it's set to localhost). If you are getting server not found then something.com doesn't resolve to an IP address. Can you ping something.com? If not, there's your answer. If something.com resolved to the IP address where Tomcat was running, and there was no virtual host defined, then Tomcat would revert to serving the default context from the default host. That's what defaultHost does. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:10 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone If I leave the defaultHost to localhost and have a host name=something.com, when I type in the url http://something.com/{webapp}/index.jsp, I get a server not found or DNS error. Do I need to define something.com anywhere else in win2000 Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:04 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Changing defaultHost is not the solution. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:51 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue
RE: Virtual Domains with Tomcat 4.1.12 Standalone
It's been a long time since I setup a Windows web server, but if I had to guess: IIS has authentication set for that resource. The anonymous web user (IUSR_SOMEMACHINENAME) account has no access to the directories where the content exists. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:32 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Thanks for the reply john. I got it. But there is one small problem yet to resolve. When I use http://something.com/{Webapp}/index.jsp, it comes back with a Basic Server Authentication window. I don't have any authentication setup in web.xml file. I am using IIS and tomcat and have defined virtualhost in server.xml file. If I access the server directly by it name, it is showing me the index page but if try with the virtualhost, I get authentication for the server. Any ideas? Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:19 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Let's put it this way. If you had to change defaultHost for virtual hosts to work, then you could never have more than one virtual host, since there is only one defaultHost. That's obviously wrong. Tomcat has the ability to serve many virtual hosts, not just one. I have several virtual hosts running on a Sun 420R at the moment, and there's only one defaultHost (and it's set to localhost). If you are getting server not found then something.com doesn't resolve to an IP address. Can you ping something.com? If not, there's your answer. If something.com resolved to the IP address where Tomcat was running, and there was no virtual host defined, then Tomcat would revert to serving the default context from the default host. That's what defaultHost does. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:10 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone If I leave the defaultHost to localhost and have a host name=something.com, when I type in the url http://something.com/{webapp}/index.jsp, I get a server not found or DNS error. Do I need to define something.com anywhere else in win2000 Hari -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:04 AM To: 'Tomcat Users List' Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Changing defaultHost is not the solution. John -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:51 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone I really don't know if changing the defaulthost name is the solution. R u able to serve the pages with the configuration you have now without changing the defaulthost name or are you getting a DNS error. IF you want to serve pages the way you want it, then each of the host entries you have in server.xml should have context defined with its own Web.xml file. Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Just wanted to let you know: I got it working. I ended up uninstalling Tomcat 4.1.12 and installing Tomcat 4.1.17, and it worked almost from the start. (I'm guessing that I somehow corrupted my server.xml file.) Thanks for all your help! On Tue, 17 Dec 2002 11:19:56 -0500, Turner, John wrote: If you post your server.xml, someone will look at it. I can't promise I will, as time is everything, but someone will. If you could remove the comments from it and post an uncommented version, that would make it smaller and easier to scan. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:12 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Got it, John. Thanks for your time. ( not being sarcastic... forgot to thank you earlier. ) ( For the record, I only posted the small snippet because that was all that I changed from out of the box ) I'll try to verify the XML tags now. ( I've thought about this before, but I'll look at it again. ) I thought that maybe I had something screwy going on with part of the request being blocked, but I honestly don't know that part intimately enough to look at it and verify that everything is coming through ok. On Tue, 17 Dec 2002 11:03:06 -0500, Turner, John wrote: No, it is not. Leave defaultHost alone. Setup a Host element for host0.com and host1.com. If this is not working, either post your entire server.xml or post log file snippets with error messages. XML files are sensitive to properly closed tags and elements...including just a small snippet of your server.xml file doesn't let anyone verify that you've positioned and closed the new tags correctly because we can't see any of the other tags. My apologies, but this is starting to get fairly tedious. Adding a new Host element is a trivial exercise, all you have to do is make sure you position it correctly and close it correctly. There's really nothing else to do. If you have to, copy server.xml to server-work.xml, delete all of the comments and other extra information, and work with the resulting smaller file until you get the new elements closed and positioned correctly. Server.xml is no different than and HTML file...position and close everything properly, and it works. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias tag to the localhost Host element in server.xml. Apache VirtualHost = Tomcat Host (roughly speaking) Host name=some.server.com ...some stuff here like Contexts, etc /Host The server.xml that comes with Tomcat has what you need already
RE: Virtual Domains with Tomcat 4.1.12 Standalone
Congratulations Norment. R u using IIS? Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 1:45 PM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Just wanted to let you know: I got it working. I ended up uninstalling Tomcat 4.1.12 and installing Tomcat 4.1.17, and it worked almost from the start. (I'm guessing that I somehow corrupted my server.xml file.) Thanks for all your help! On Tue, 17 Dec 2002 11:19:56 -0500, Turner, John wrote: If you post your server.xml, someone will look at it. I can't promise I will, as time is everything, but someone will. If you could remove the comments from it and post an uncommented version, that would make it smaller and easier to scan. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:12 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Got it, John. Thanks for your time. ( not being sarcastic... forgot to thank you earlier. ) ( For the record, I only posted the small snippet because that was all that I changed from out of the box ) I'll try to verify the XML tags now. ( I've thought about this before, but I'll look at it again. ) I thought that maybe I had something screwy going on with part of the request being blocked, but I honestly don't know that part intimately enough to look at it and verify that everything is coming through ok. On Tue, 17 Dec 2002 11:03:06 -0500, Turner, John wrote: No, it is not. Leave defaultHost alone. Setup a Host element for host0.com and host1.com. If this is not working, either post your entire server.xml or post log file snippets with error messages. XML files are sensitive to properly closed tags and elements...including just a small snippet of your server.xml file doesn't let anyone verify that you've positioned and closed the new tags correctly because we can't see any of the other tags. My apologies, but this is starting to get fairly tedious. Adding a new Host element is a trivial exercise, all you have to do is make sure you position it correctly and close it correctly. There's really nothing else to do. If you have to, copy server.xml to server-work.xml, delete all of the comments and other extra information, and work with the resulting smaller file until you get the new elements closed and positioned correctly. Server.xml is no different than and HTML file...position and close everything properly, and it works. John -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:36 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone Hari: Thanks for the response. ( For that matter, thanks for everyone's response so far... ) I want the behavior to be: http://localhost - loads up the default welcome page, root/index.jsp http://host0.com - loads up host0's index page http://host1.com - loads up host1's index page Is changing the default host part of the solution? On Tue, 17 Dec 2002 10:22:20 -0500, Hari Venkatesan wrote: You have two Host name defined and only one closing tag for the host. Did you change Engine name=Standalone defaultHost=localhost debug=99 to reflect host0.com in the defaultHost Hari -Original Message- From: J. Norment [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:15 AM To: Tomcat Users List Subject: RE: Virtual Domains with Tomcat 4.1.12 Standalone This is the change that I had made to the server.xml file: !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true !-- This part is added: -- Host name=host0.com debug=0 appBase=webapps/host0 unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=host0. suffix=.log timestamp=true/ Context path= docBase=webapps/host0 debug=0 reloadable=true/ Context path=/test docBase=webapps/host0 debug=0 reloadable=true/ /Host !-- End, added part. -- Is this is the change that you are referring to in adding the host tag? If that is not working, how would I track down what is broken? (ie, are there log files saying exactly what Tomcat is getting from the request?) As for adding an alias for localhost, wouldn't that mean that only one host was used? Ultimately, I'd like host0.com and host1.com to be different hosts for Tomcat. Applying Occam's Razor, I'm pretty sure that something is screwed on my end, but not sure how to track it down, at this point... On Tue, 17 Dec 2002 09:27:14 -0500, Turner, John wrote: It has Apache installed, but I just verified this behavior using http://some.server.com:8080 which bypasses Apache. If you need a virtual host setup in Tomcat, modify server.xml and add a Host element with a name parameter set to the FQDN that will be in the URL. Alternatively, if you want some.server.com to be treated as localhost, add an Alias
Tomcat 4.1 and Virtual Domains
I have looked high and low to try to avoid posting yet *another* question on how to set up Tomcat with virtual domains, however, I have not been able to find what I've been looking for. I have Tomcat 4.1 set up and have followed the FAQ at http://www.galatea.com/flashguides/virtual-hosting-tomcat.xml , but can only get the default index.jsp to display with www.domain0.com and www.domain1.com ... what might I be doing wrong? Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: virtual domains in tomcat4.0 standalone mode
Ken, Check out the Alias directive within you Host entry in server.xml. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/host.html under Host Name Aliases HTH, Joel. Grondell, Ken [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... | is it possible to have virtual domains in tomcat standalone mode or do you | need use apache. | | if you can have a virtual domain in tomcat how do you do it? all of the | documentation I have seen points to using apache. | | I would like to have | www.foo.com go to ROOT/foo/ | and www.foo2.com go to ROOT/foo/ | | Thanks | Ken | | -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
virtual domains in tomcat4.0 standalone mode
is it possible to have virtual domains in tomcat standalone mode or do you need use apache. if you can have a virtual domain in tomcat how do you do it? all of the documentation I have seen points to using apache. I would like to have www.foo.com go to ROOT/foo/ and www.foo2.com go to ROOT/foo/ Thanks Ken -Original Message- From: Alvin Wang [mailto:[EMAIL PROTECTED]] Sent: Friday, May 03, 2002 10:06 AM To: Tomcat Users List Subject: Urgent.. Please help me Hi! I have an urgent question. Could any guru help me to diagnosis it? I'm using tomcat 4.0. My servlet gets the DataSource from JNDI. However, it raise the following exception: javax.naming.NameNotFoundException: Name java:comp is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:811) at org.apache.naming.NamingContext.lookup(NamingContext.java:194) at javax.naming.InitialContext.lookup(InitialContext.java:350) That means the the whole java:comp cannot be found, which I think should have nothing to do with my DataSource resource setup in my web application context. Also I use javax.naming.NamingEnumeration ne = initCtx.list(); I found there is nothing under JNDI root. I think there is much some configuration not right. Can any gurus help? thanks so much! Alvin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: problems useing tomcat with virtual domains. (fwd)
[EMAIL PROTECTED] a écrit : i have name based virtual domains ( many domains one ip address ) and i have problems with tomcat, i want to be able to keep my servlet directoryes in different parents. now everything is at one place i have no problems with jsp's i can put one jsp in witch domains directory i want but with the servlets i have this problem. now i have to write symlinks from domains's directory to the directory where tomcat want to be his servlets, and all the servlets are at one place - /usr/share/java/servlets and when i GET www.xxx.org/servlet/z HTTP1.1 tomcat seeks in /usr/share/java/servlets ( i want to make him to seek in /usr/share/java/servlets/xxx.org for example ) i am useing debian as linux distrib, on i386 based system. can you help me? # system administrator, interbgc.com # mail to : [EMAIL PROTECTED] # www page: http://web.interbgc.com/~noun # icq uin : 8912353 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] Well i think yu could, in a first time, try yo get and read the different HOW-TO's concerning Tomcat. In a Service, yu will have one or several Connectors against one Engine. In this Engine [ one per Service ] yu can declare several Host corresponding, for instance, to the different Virtual Host yu desired to be set. In this Host Directive, yu can set many things and especially the mandatory ones: - appBase The Application Base directory for this virtual host. This is the pathname of a directory thatmay contain web applications to be deployed on this virtual host. You may specify an absolute pathname for this directory, or a pathname that is relative to the $CATALINA_HOME directory. See Automatic Application Deployment for more information on automatic recognition and deployment of web applications to be deployed automatically. - name Network name of this virtual host, as registered in your Domain Name Service server. One ofthe Hosts nested within an Engine MUST have a name that matches the defaultHost setting for that Engine. See Host Name Aliases for information on how to assign more than one network name to the same virtual host. Here yu will find the HOW-TO i red: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/host.html The best advice i can give yu: Read this HOW-TO's since they can explain and help for a lot. I'm against the same business and discoverin' more and more tricks each day. Hope this help. Regards. Jean-Luc B :O) -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
problems useing tomcat with virtual domains. (fwd)
i have name based virtual domains ( many domains one ip address ) and i have problems with tomcat, i want to be able to keep my servlet directoryes in different parents. now everything is at one place i have no problems with jsp's i can put one jsp in witch domains directory i want but with the servlets i have this problem. now i have to write symlinks from domains's directory to the directory where tomcat want to be his servlets, and all the servlets are at one place - /usr/share/java/servlets and when i GET www.xxx.org/servlet/z HTTP1.1 tomcat seeks in /usr/share/java/servlets ( i want to make him to seek in /usr/share/java/servlets/xxx.org for example ) i am useing debian as linux distrib, on i386 based system. can you help me? # system administrator, interbgc.com # mail to : [EMAIL PROTECTED] # www page: http://web.interbgc.com/~noun # icq uin : 8912353 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Tomcat 3.2.1 and virtual domains
Hi, I'm trying to set up a virtual domain with tomcat v3.2.1. If I add a Context it works just fine and tomcat adds what it needs to mod_jk.conf-auto and then I include that in httpd.conf. What's not working is when I try Host like this: Host name=virtualdomain.com Alias name=www.virtualdomain.com Context path= docBase=/path/to/files/ /Alias /Host Nothing is added in mod_jk.conf-auto, just the contexts I added outside Host. So my 'fix' was to create a index.html with, htmlhead meta http-equiv=refresh \ content=0;url=http://virtualdomain.com/context/index.jsp; /head/html and a context in server.xml, Context path/context docBase=/path/to/files/ crossContext=true debug=0 reloadable=false trusted=false /Context Any idea? I'm not used to tomcat (just hosting this) so if you guys need more information just ask. Thanks in advance. -- Giovanni P. Tirloni [EMAIL PROTECTED] BS2 Sistemas para Internet Ltda. +55 44 263 6300 (work) Network Administrator +55 44 9112 0693 (mobile) -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Tomcat 3.2.1 and virtual domains
I don't believe that Tomcat 3.2.x supports including virtual host information in the auto-generated mod_jk.conf-auto. However, if you want to give it a try, Tomcat 3.3 does. For details, see: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.html#context_addcust If you try it, be sure to use Tomcat 3.3's mod_jk and set noRoot=false on the ApacheConfig element in the server.xml since you are trying to serve a root context on the virtual site. Cheers, Larry -Original Message- From: Giovanni P. Tirloni [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 02, 2002 2:34 PM To: [EMAIL PROTECTED] Subject: Tomcat 3.2.1 and virtual domains Hi, I'm trying to set up a virtual domain with tomcat v3.2.1. If I add a Context it works just fine and tomcat adds what it needs to mod_jk.conf-auto and then I include that in httpd.conf. What's not working is when I try Host like this: Host name=virtualdomain.com Alias name=www.virtualdomain.com Context path= docBase=/path/to/files/ /Alias /Host Nothing is added in mod_jk.conf-auto, just the contexts I added outside Host. So my 'fix' was to create a index.html with, htmlhead meta http-equiv=refresh \ content=0;url=http://virtualdomain.com/context/index.jsp; /head/html and a context in server.xml, Context path/context docBase=/path/to/files/ crossContext=true debug=0 reloadable=false trusted=false /Context Any idea? I'm not used to tomcat (just hosting this) so if you guys need more information just ask. Thanks in advance. -- Giovanni P. Tirloni [EMAIL PROTECTED] BS2 Sistemas para Internet Ltda. +55 44 263 6300 (work) Network Administrator +55 44 9112 0693 (mobile) -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
jsp access under apache virtual domains
Hi, I am havig a bit of trouble in the conversion from jserve + gnujsp to tomcat with libapache-mod-jk. Apache seems to be working fie, the tomcat examples are working fine, but I can't access .jsp pages from my apache virtualhosts. For example if I had host admin.warpspeed.net.au set up as follows VirtualHost 203.45.208.18:80 ServerName admin.warpspeed.net.au DocumentRoot /home/users/admin/www/public_html ErrorLog /home/users/admin/www/logs/error.log TransferLog /home/users/admin/www/logs/access.log ScriptAlias /cgi-bin/ /home/users/admin/www/cgi-bin/ JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 JkMount /*.xml ajp13 AddType text/xml .xml /VirtualHost LoadModule jk_module /usr/lib/apache/1.3/mod_jk.so IfModule mod_jk.c JkWorkersFile /etc/apache/mod_jk/workers.properties Include /etc/apache/mod_jk/tomcat-auto /IfModule which is how I have it configured, and I had a test.jsp page under /home/users/admin/www/public_html/test.jsp then shouldn't I be able to browse to http://admin.warpspeed.net.au/test.jsp note: I can get to http://admin.warpspeed.net.au/index.html with no worries. When I browse to my test.jsp page I get an apache 500 error internal server error. I checked the logs in /var/log/apache/error.log /home/users/admin/www/logs/error.log and /var/log/tomcat/* and there didn't seem to be any reason why I'd be getting such an error. Just some system info: I am running a Debian Linux system, kernel 2.4.4, and the following packages. ii apache 1.3.19-1 Versatile, high-performance HTTP server ii apache-common 1.3.19-1 Support files for all Apache webservers ii java-common0.7Base of all Java packages ii libxerces-java 1.3.1-1Validating XML parser for Java ii tomcat 3.2.1-1Java Servlet 2.2 engine with JSP 1.1 support ii libapache-mod-jk 3.2.1-1Apache connector for Tomcat servlet engine ii j2sdk1.3 1.3.0-2Blackdown Java(TM) 2 SDK, Standard Edition ii jikes 1.12.20010116- Fast Java compiler adhering to language and I basicly want any *.jsp page under any apache virtualhost to be processed by tomcat. What might I have done wrong in my config get this 500 error? -- Mitchell Smith Blitz Technology [EMAIL PROTECTED] Experience is that marvelous thing that enables you to recognize a mistake when you make it again. -- F. P. Jones
AW: Tomcat with multiple virtual domains
Hi look at the documents : http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html you will find some information in the document working with mod_jk. are you familiar with virtual host ? you have to make changes in httpd.conf and in the file server.xml (tomcat parameter file). regards markus -Ursprngliche Nachricht- Von:Rooms Christoph [SMTP:[EMAIL PROTECTED]] Gesendet am:Dienstag, 16. Januar 2001 11:39 An: [EMAIL PROTECTED] Betreff:Tomcat with multiple virtual domains Hi, My provider is gonna set up Tomcat for me. He is already using Apache WebServer. On one machine he is running multiple virtual domains. What is the way to implement this. What access should he give to his users ? = developpers. How can the different developpers restart the server ? Isn't there a white paper on this ? Thanks, Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: AW: Tomcat with multiple virtual domains
Thanks Marcus ! This document was exactly what I needed. I only have now a few extra questions. 1. Are HTML files now putted in the Tomcat directory or is it better to keep them seperate. (for performance ?) It would be easy to put it all in the Tomcat directory so we can use WAR's. 2. If you have multiple instances of Tomcat running, will each instance have it own server.xml ? How can each Developper start his own server? Thanks ! Christoph [EMAIL PROTECTED] wrote: Hi look at the documents : http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html you will find some information in the document working with mod_jk. are you familiar with virtual host ? you have to make changes in httpd.conf and in the file server.xml (tomcat parameter file). regards markus -Ursprngliche Nachricht- Von: Rooms Christoph [SMTP:[EMAIL PROTECTED]] Gesendet am: Dienstag, 16. Januar 2001 11:39 An:[EMAIL PROTECTED] Betreff: Tomcat with multiple virtual domains Hi, My provider is gonna set up Tomcat for me. He is already using Apache WebServer. On one machine he is running multiple virtual domains. What is the way to implement this. What access should he give to his users ? = developpers. How can the different developpers restart the server ? Isn't there a white paper on this ? Thanks, Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
AW: AW: Tomcat with multiple virtual domains
Hi Christoph I'm glad I could help you. 1. As I remember it's not important where you have your files. What is important, that apache solves the static part of your application and the dynamic part is done by tomcat. 2. you will find answers in the document tomcat-apache HOWTO, chapter multiple tomcat JVMs. regards Markus -Ursprngliche Nachricht- Von:Rooms Christoph [SMTP:[EMAIL PROTECTED]] Gesendet am:Dienstag, 16. Januar 2001 12:11 An: [EMAIL PROTECTED] Betreff:Re: AW: Tomcat with multiple virtual domains Thanks Marcus ! This document was exactly what I needed. I only have now a few extra questions. 1. Are HTML files now putted in the Tomcat directory or is it better to keep them seperate. (for performance ?) It would be easy to put it all in the Tomcat directory so we can use WAR's. 2. If you have multiple instances of Tomcat running, will each instance have it own server.xml ? How can each Developper start his own server? Thanks ! Christoph [EMAIL PROTECTED] wrote: Hi look at the documents : http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html you will find some information in the document working with mod_jk. are you familiar with virtual host ? you have to make changes in httpd.conf and in the file server.xml (tomcat parameter file). regards markus -Ursprngliche Nachricht- Von: Rooms Christoph [SMTP:[EMAIL PROTECTED]] Gesendet am: Dienstag, 16. Januar 2001 11:39 An:[EMAIL PROTECTED] Betreff: Tomcat with multiple virtual domains Hi, My provider is gonna set up Tomcat for me. He is already using Apache WebServer. On one machine he is running multiple virtual domains. What is the way to implement this. What access should he give to his users ? = developpers. How can the different developpers restart the server ? Isn't there a white paper on this ? Thanks, Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: virtual domains config...
On Wed, Jan 03, 2001 at 01:31:59PM +0530, Parvez wrote: how do i configure httpd.conf to integrate tomcat only for one of the virtual domains, i tried to include tomcat-apache.conf in that virtual domain. but does not work. has anyone tried it. Just put the mount directives into the virtualhost block and the rest outside. -- Ingo Luetkebohle / [EMAIL PROTECTED] / 95428014 / |SchemantiX Open Source contact; Computational Linguistics |student; Fargonauten.DE sysadmin; Gimp Registry maintainer; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: virtual domains config...
hi thanks Ingo, i got it done for the virtual domains. it says file not found for the other domain, i.e. when i type http://otherdomain.foo.com/examples/jsp/test.jsp but when i enter http://otherdomain.foo.com:8080/examples/jsp/test.jsp it shows me the file. How do i restrict the jsp's and servlets on port 8080 also. parvez And Then Ingo Luetkebohle wrote . On Wed, Jan 03, 2001 at 01:31:59PM +0530, Parvez wrote: how do i configure httpd.conf to integrate tomcat only for one of the virtual domains, i tried to include tomcat-apache.conf in that virtual domain. but does not work. has anyone tried it. Just put the mount directives into the virtualhost block and the rest outside. -- Ingo Luetkebohle / [EMAIL PROTECTED] / 95428014 / |SchemantiX Open Source contact; Computational Linguistics |student; Fargonauten.DE sysadmin; Gimp Registry maintainer; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
virtual domains config...
hi, how do i configure httpd.conf to integrate tomcat only for one of the virtual domains, i tried to include tomcat-apache.conf in that virtual domain. but does not work. has anyone tried it. thanks in advance. parvez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Virtual Domains
Could somone please help me with Virtual Domains for Tomcat 3.2? I'm runing Sco Unixware 7.1 , Tomcat 3.2, and Apache 1.3.12. I am also using all the example and default configurations of that come with Tomcat3.2 The onlines docs show the configuration for virtual domains to look like this? ## #Apache Tomcat Virtual Hosts Sample Configuration# ## LoadModule jserv_module modules/ApacheModuleJServ.dll IfModule mod_jserv.c ApJServManual on ApJServDefaultProtocol ajpv12 ApJServSecretKey DISABLED ApJServMountCopy on ApJServLogLevel notice ApJServDefaultHost localhost ApJServDefaultPort 8007 # 1 Creating an Apache virtual host configuration NameVirtualHost 9.148.16.139 # 2 Mounting the first virtual host VirtualHost 9.148.16.139 ServerName www.vhost1.com ApJServMount /examples ajpv12://localhost:8007/examples /VirtualHost # 3 Mounting the second virtual host VirtualHost 9.148.16.139 ServerName www.vhost2.com ApJServMount /examples ajpv12://localhost:8009/examples /VirtualHost /IfModule What about the Context mapping for /examples above ?? This outline did not show any. Would I do the context mapping before or after the above Virtual Host configurations? This is what my /examples context mapping looks, it is the default Tomcat configuration in the tomcat-apache.conf that I have not touched, my question here is, if I still havae to include this, do I change the way in which this was done when using virtual host? Or does it remain this same? Alias /examples "/home/flalone/jakarta-tomcat-3.2/webapps/examples" Directory "/home/flalone/jakarta-tomcat-3.2/webapps/examples" Options Indexes FollowSymLinks /Directory ApJServMount /examples/servlet /examples Location "/examples/WEB-INF/" AllowOverride None deny from all /Location Location "/examples/META-INF/" AllowOverride None deny from all /Location Thank You Very Much Frank LaLone
RE: virtual domains
It should be like this, the Virtual Host directive. Host name="shuklix.shuklix.com" Context path="" docBase="/shuklix/shuklix/" / /Host SHuklix -Original Message- From: Carlos [mailto:[EMAIL PROTECTED]] Sent: Monday, November 27, 2000 9:06 PM To: [EMAIL PROTECTED] Subject: virtual domains Anyboy can send me a server.xml with virtual domains for tomcat 3.2 b8 with apache? I dont understand the manula thanks
virtual domains
Anyboy can send me a server.xml with virtual domains for tomcat 3.2 b8 with apache? I dont understand the manula thanks
virtual domains and web.xml, server.xml
if i use several virtual domains i have put in each virtual domain a server.xml and web.xml file? thanks Carlos UNICA Comunicación Global www.unicaonline.com [EMAIL PROTECTED] Iparraguirre 61, 2º. 48010 BILBAO Tel.: 902 152099 Fax: 944 442735
virtual domains and classes
for a virtual domain can i say that the classes are in the ROOT/WE-INF/classes and in the ROOT/WEB-INF/classes/user? is possible the both? thanks Carlos
virtual domains-hosting
I kown how to define in apache the virtual domains. I definet them but i am using apache with tomcat. when i want to use in my machine virtual domains i must define in the apache conf file (httpd.conf) only or in the apache conf file and in the tomcat conf file? if i must to define also in the tomcat conf file, how i must to define the virtual domain? anybody can send me a example? thanks Carlos