Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
JSP - A mailing list about Java Server Pages specification and reference
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Apache and Tomcat with Multiple Virtual Hosts

Apache and Tomcat with Multiple Virtual Hosts

2006-11-28       - By Chris Duesing

 Back
Hello,



I am trying to add a second web application to my server, and in doing
so I have taken the approach of using multiple virtual hosts in both
Apache and Tomcat. The configuration I am using is not currently working
and I was hoping someone might spot the reason.



Background:

Apache 2.2

Tomcat 5.5.17

2 java webapps running jsp's under tomcat and 1 with static content
under apache.

1 webapp requires https/ssl

Subdomains for each app so they can be at the root, rather than having
different context paths.

Mod_proxy and mod_rewrite to communicate between apache and tomcat.



Here are what I believe to be the relevant excerpts from the apache
httpd.conf and tomcat server.xml files.





Httpd.conf:

...

<VirtualHost xxx.xxx.xx.xx:443>                

 ServerName            example1.ccx.com

...

ProxyPass / http://example1.ccx.com:8443/

</VirtualHost>



...



<VirtualHost xxx.xxx.xx.xx:80>      

 ServerName            example2.ccx.com
<http://www.staging.chicagoclimatex.com/>

...

   RewriteEngine On

   RewriteRule ^(.*)(\.jsp)(.*)$ http://example2.ccx.com:8080/$1$2$3
[P,L]

</VirtualHost>









Server.xml:

...

<Service name="Catalina">

...

<Connector port="8080" maxHttpHeaderSize="8192"

              maxThreads="150" minSpareThreads="25"
maxSpareThreads="75"

              enableLookups="false" redirectPort="8443"
acceptCount="100"

              connectionTimeout="20000" disableUploadTimeout="true" />

...

<Connector port="8443" maxHttpHeaderSize="8192"

              maxThreads="150" minSpareThreads="25"
maxSpareThreads="75"

              enableLookups="false" disableUploadTimeout="true"

              acceptCount="100" scheme="https" secure="true"

              clientAuth="false" sslProtocol="TLS" />

...

<Engine name="Catalina" defaultHost="climateexchange.com">



  <Host name="example1.ccx.com" appBase="webapps/example1_ccx_com"

      unpackWARs="true" autoDeploy="true"

      xmlValidation="false" xmlNamespaceAware="false">

           

  </Host>



  <Host name="example2.ccx.com" appBase="webapps/example2_ccx_com"

      unpackWARs="true" autoDeploy="true"

      xmlValidation="false" xmlNamespaceAware="false">



 </Host>

...



Thanks for the help,



Chris Duesing

Java Developer

Chicago Climate Exchange, Inc.

312 229 5152, direct

312 554 3350, main

312 554 3373, fax

cduesing@(protected)

Visit us at www.chicagoclimateexchange.com

******************************************

This e-mail and any of its attachments may contain proprietary
information, which is privileged, confidential, or subject to copyright
belonging to the Chicago Climate Exchange, Inc. This e-mail is intended
solely for the use of the individual or entity to which it is addressed.
If you are not the intended recipient of this e-mail, you are hereby
notified that any dissemination, distribution, copying, or action taken
in relation to the contents of and attachments to this e-mail is
strictly prohibited and may be unlawful. If you have received this
e-mail in error, please notify the sender immediately and permanently
delete.




©2008 junlu.com - Jax Systems, LLC, U.S.A.