-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/12/2015 7:30 PM, Kiran Badi wrote:
> Thanks Hassan/Prabhu/Charles for reply.
> 
> I tried the options given in this link.
> 
> http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts
> 
> but for some reasons still its not working.I have pasted the server
> xml for reference. I have unlimited website hosting plan with
> arvixe.com , but for some reasons it's still not working.Not sure
> if these guys needs to add something special to hosts file.
> 
> here is link for actual site -
> 
> homelyhotels.com - you will probably see cgi-bin folder.
> 
> Below server xml, I have added just a second host tag for webapp2.
> I am bit hesitant to make changes wrt to webapp1(removing context
> tags etc due to lack of time on my end along with lack of
> sufficient knowledge in case something breaks,however I will
> eventually clean that as well).
> 
> <?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache
> Software Foundation (ASF) under one or more contributor license
> agreements.  See the NOTICE file distributed with this work for
> additional information regarding copyright ownership. The ASF
> licenses this file to You under the Apache License, Version 2.0 
> (the "License"); you may not use this file except in compliance
> with the License.  You may obtain a copy of the License at
> 
> http://www.apache.org/licenses/LICENSE-2.0
> 
> Unless required by applicable law or agreed to in writing,
> software distributed under the License is distributed on an "AS IS"
> BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
> or implied. See the License for the specific language governing
> permissions and limitations under the License. --> <!-- Note:  A
> "Server" is not itself a "Container", so you may not define
> subcomponents such as "Valves" at this level. Documentation at
> /docs/config/server.html --> <Server port="17700"
> shutdown="SHUTDOWN"> <!-- Security listener. Documentation at
> /docs/config/listeners.html <Listener
> className="org.apache.catalina.security.SecurityListener" /> --> 
> <!--APR library loader. Documentation at /docs/apr.html --> 
> <Listener
> className="org.apache.catalina.core.AprLifecycleListener" 
> SSLEngine="on" /> <!--Initialize Jasper prior to webapps are
> loaded. Documentation at /docs/jasper-howto.html --> <Listener
> className="org.apache.catalina.core.JasperListener" /> <!-- Prevent
> memory leaks due to use of particular java/javax APIs--> <Listener 
> className="org.apache.catalina.core.JreMemoryLeakPreventionListener"
> /> <Listener 
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
"
> /> <Listener 
> className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"
> />
> 
> <!-- Global JNDI resources Documentation at
> /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!--
> Editable user database that can also be used by UserDatabaseRealm
> to authenticate users --> <Resource name="UserDatabase"
> auth="Container" type="org.apache.catalina.UserDatabase" 
> description="User database that can be updated and saved" 
> factory="org.apache.catalina.users.MemoryUserDatabaseFactory" 
> pathname="conf/tomcat-users.xml" /> </GlobalNamingResources>
> 
> <!-- A "Service" is a collection of one or more "Connectors" that
> share a single "Container" Note:  A "Service" is not itself a
> "Container", so you may not define subcomponents such as "Valves"
> at this level. Documentation at /docs/config/service.html --> 
> <Service name="Catalina">
> 
> <!--The connectors can use a shared executor, you can define one
> or more named thread pools--> <!-- <Executor
> name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="10"
> minSpareThreads="5"/> -->
> 
> 
> <!-- A "Connector" represents an endpoint by which requests are
> received and responses are returned. Documentation at : Java HTTP
> Connector: /docs/config/http.html (blocking & non-blocking) Java
> AJP  Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector:
> /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 
> --> <Connector port="17701" protocol="HTTP/1.1" 
> connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector"
> using the shared thread pool--> <!-- <Connector
> executor="tomcatThreadPool" port="17702" protocol="HTTP/1.1" 
> connectionTimeout="20000" redirectPort="8443" /> -->
> 
> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector
> port="17703" protocol="AJP/1.3" redirectPort="8444" />
> 
> 
> <!-- An Engine represents the entry point (within Catalina) that 
> processes every request.  The Engine implementation for Tomcat
> stand alone analyzes the HTTP headers included with the request,
> and passes them on to the appropriate Host (virtual host). 
> Documentation at /docs/config/engine.html -->
> 
> <!-- You should set jvmRoute to support load-balancing via AJP ie
> : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> 
> --> <Engine name="Catalina" defaultHost="localhost">
> 
> <!--For clustering, please take a look at documentation at: 
> /docs/cluster-howto.html  (simple how to) /docs/config/cluster.html
> (reference documentation) --> <!-- <Cluster
> className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> -->
> 
> <!-- Use the LockOutRealm to prevent attempts to guess user
> passwords via a brute-force attack --> <Realm
> className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm
> uses the UserDatabase configured in the global JNDI resources under
> the key "UserDatabase".  Any edits that are performed against this
> UserDatabase are immediately available for use by the Realm.  --> 
> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" 
> resourceName="UserDatabase"/> </Realm>
> 
> <Host name="localhost"  appBase="webapps" unpackWARs="true"
> autoDeploy="true">
> 
> <!-- SingleSignOn valve, share authentication between web 
> applications Documentation at: /docs/config/valve.html --> <!-- 
> <Valve className="org.apache.catalina.authenticator.SingleSignOn"
> /> -->
> 
> <!-- Access log processes all example. Documentation at:
> /docs/config/valve.html Note: The pattern used is equivalent to
> using pattern="common" --> <Valve
> className="org.apache.catalina.valves.AccessLogValve" 
> directory="logs" prefix="localhost_access_log." suffix=".txt" 
> pattern="%h %l %u %t &quot;%r&quot; %s %b" />
> 
> </Host>
> 
> <Host name="webapp1" appBase="/home/myhostid/tomcat/webapps"> 
> <Alias>www.webapp1.com</Alias> 
> <Alias>myhostid.myserver.mywebhost.com</Alias> <Context
> path="/manager" debug="0" privileged="true" 
> docBase="/home/myhostid/tomcat/webapps/manager"> </Context> 
> </Host> <Host name="webapp2.com" 
> appBase="/home/myhostid/hosts/webapp2/webapps"
> xmlValidation="false" xmlNamespaceAware="false" unpackWARs="true"
> autoDeploy="true"> <Alias>www.webapp2.com</Alias> <Valve
> className="org.apache.catalina.valves.AccessLogValve" 
> directory="logs" prefix="webapp2_access_log." suffix=".txt" 
> pattern="%h %l %u %t &quot;%r&quot; %s %b" /> </Host> </Engine> 
> </Service> </Server>
> 

Are you fronting your Tomcat server with Apache HTTPD? It's difficult
to tell from the headers coming back, but it appears so.

If so, the Wiki article you reference gives you some, but not all of
the picture (I know, because I wrote that article).

However, it also appears from your server.xml above that localhost and
webapp1 are the same?

That's OK if the localhost should serve webapp1. If that's the case,
there's no need for the webapp1 Host. Just add an Alias to the
localhost Host for webapp1. Or even better don't add an Alias and let
Tomcat serve the default host when it doesn't match a Host
name="somehost" or Alias.

If you're fronting Tomcat with Apache HTTPD, then there is some more
work that needs to be done.

We run multiple virtual hosts on Apache HTTPD. Some of the virtual
hosts are proxied to the same Tomcat server, and some are proxied to
separate Tomcat servers.

It's kind of messy, but we do this to make use of SAN certificates for
SSL.

. . . . just my two cents
Mark
/mde/

> 
> 
> 
> On Tue, May 12, 2015 at 7:43 AM, Caldarale, Charles R < 
> chuck.caldar...@unisys.com> wrote:
> 
>>> From: Kiran Badi [mailto:ki...@poonam.org] Subject: Re: Tomcat
>>> 7.0.57 - Deployment Issue
>> 
>>> for some reasons it's not going well. Its getting deployed as
>>> single app www.mywebapp1.com\mywebapp2\ rather than 2 seperate
>>> sites.
>> 
>> Which is exactly what you configured it to do.
>> 
>>> mywebapp1 is deployed as root.war
>> 
>> That should be ROOT.war; be precise - this is all
>> case-sensitive.
>> 
>>> and I uploaded the webapp2.war in webapps folder and edited
>>> server.xml
>> with
>>> below details,
>> 
>>> <Host name="www.webapps2.com"
>>> appBase="/home/myhostid/tomcat/webapps"> 
>>> <Alias>www.webapps2.com</Alias> 
>>> <Alias>myhostid.myhost.myhostserver.com</Alias>
>> 
>> An <Alias> element does not create a second site; it merely
>> provides an alternate name for a given site.  You need multiple
>> <Host> elements if you want separate sites.  Read these: 
>> http://wiki.apache.org/tomcat/CreateVirtualHosts 
>> http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts
>> 
>>> <Context path="/manager" debug="0" privileged="true" 
>>> docBase="/home/myhostid/tomcat/webapps/webapps2">
>> 
>> Do not put <Context> elements in server.xml - very bad idea.
>> Also, the debug attribute has not be used for nearly a decade.
>> You really, really need to read the documentation.
>> 
>>> I did not touch webapp1 app since its deployed as root.war and
>>> its
>> working
>>> fine..
>> 
>> Not with that name, it isn't.
>> 
>>> One more thing, do need have one more connector tag as I see
>>> these error
>> on
>>> catalina logs
>> 
>>> May 11, 2015 7:11:51 PM org.apache.coyote.AbstractProtocol
>>> init SEVERE: Failed to initialize end point associated with
>>> ProtocolHandler ["http-bio-17701"] java.net.BindException:
>>> Address already in use <null>:17701
>> 
>> You appear to have two <Connector> elements with the same port.
>> 
>> - Chuck
>> 
>> 
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
>> PROPRIETARY MATERIAL and is thus for use only by the intended
>> recipient. If you received this in error, please contact the
>> sender and delete the e-mail and its attachments from all
>> computers.
>> 
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJVUtUtAAoJEEFGbsYNeTwtzn0H/24SIID2TeRE6Lc9HuRX//OR
3tZ2X/dgL2N/IpJGePkzIDPPvxtXsA3mynoHsM/Hrv5wUVB/9JT4Kep+EVjrSpP1
CgLbuK9Nekr9UpIPBF2ZCG7A3Qb9I/hTTk5ahuTcw0GfyktFM14u/o1IlOZHhs2B
u2AzVU6uwoQZh2owF5/7cDT4pDeFTm5NhCGkHjecLSVdsAGSBJR4TvJs35o5olDg
iG8uljLHOl/gLLzeJPk8UK2a4Ruaiiiim3s8AbXaYoBmmENvxyUo5l4yh0uNTfjR
eMWHMFaRRpgezqzxpRG62sX8xebw1pvDh8lEYO6OLRudP36UhH0YvXoNFK0ZdCk=
=bcwd
-----END PGP SIGNATURE-----

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to