Re: tomcat - How to forward request to some webapp while using port 80 without virtual host, without apache

2013-12-29 Thread André Warnier

Peter wrote:

I am happy that you guys sent reply to me, but anyone here can create
configuration file for me for example which I had mentioned in beginning of
post, then I can understand better, its my weakness but true.



Peter, you should decide what you want, and whether the way in which to do it, is more 
important for you than the goal that you want to reach, or vice-versa.


From what I understand, the final result that you want to achieve is that
1) there is only one Tomcat server instance
2) when a client calls up http://client1.company.com/, this ends up being served by the 
application /client1
3) when a client calls up http://client2.company.com/, this ends up being served by the 
application /client2


The easiest and most natural way to do this, is by using Virtual Hosts, and have 
client1 and client2 being in fact the ROOT webapps of each of these virtual hosts.

Like this :

DNS :
a.b.c.d client1.company.com
a.b.c.d client2.company.com
(same IP for both)

Tomcat connectors : listen on the IP address a.b.c.d

Tomcat virtual hosts :
First, the default host (it is already there, nothing to change)
Host name=localhost appBase=(tomcat_dir)/webapps ..
  .. here you host Tomcat's standard webapps (just leave them where they are)
/Host

Then you add the following 2 Hosts :

Host name=client1.company.com appBase=/dir1/webapps ...
... here you host the client1 webapp, renamed to ROOT, as in 
/dir1/webapps/ROOT/..
/Host

Host name=client2.company.com appBase=/dir2/webapps ...
... here you host the client2 webapp, renamed to ROOT, as in 
/dir2/webapps/ROOT/..
/Host

This is a still single Tomcat.  The fact of using virtual hosts does not mean that there 
are more than 1 Tomcat.  It is the same single Tomcat serving all 3 above virtual hosts.

It just changes its personality depending on how the client gets to it (by 
the name).

But, in the subject of your message, you say that you do not want virtual hosts.

That's a pity, because any other way of doing what you seem to want to do, is a lot more 
complicated, and a lot more complicated still to get right in all cases.


So, once again, *why* do you not want virtual hosts ?
If you do not really care, then I suggest that you start a new message thread, with a 
different title where you do not exclude virtual hosts from the start, and just explain 
what you want to achieve in the end, without excluding any particular solution right away.



For the rest, apart from the on-line Tomcat documentation, there are also books and 
articles available : http://tomcat.apache.org/resources.html.
If what you want is to have someone spoon feed a complete configuration to you, that 
will work in your case without any effort on your part, then you should consider hiring a 
paid consultant.

There is also a list here : http://wiki.apache.org/tomcat/SupportAndTraining


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



RE: tomcat - How to forward request to some webapp while using port 80 without virtual host, without apache

2013-12-28 Thread Caldarale, Charles R
 From: Peter [mailto:nex@gmail.com] 
 Subject: tomcat - How to forward request to some webapp while using port 80 
 without virtual host, without apache

 if I enter *http://client1.host.com http://client1.host.com* on browser,
 then tomcat should forward it to webapp client1

 *http://client1.host.com/client1 http://client1.host.com/client1*
 same way if I enter *http://client2.host.com http://client2.host.com *it
 should forward to to

 *http://client2.host.com/client2 http://client2.host.com/client2*

 *I am not interested to use virtual host in tomcat, as well as http apache*
 whether its possible ???

Many people use a filter to accomplish this; http://tuckey.org/urlrewrite/ is 
the most popular.

 - 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



Re: tomcat - How to forward request to some webapp while using port 80 without virtual host, without apache

2013-12-28 Thread Peter
On Sat, Dec 28, 2013 at 6:48 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:
 From: Peter [mailto:nex@gmail.com]
 Subject: tomcat - How to forward request to some webapp while using port
80 without virtual host, without apache

 if I enter *http://client1.host.com http://client1.host.com* on browser,
 then tomcat should forward it to webapp client1

 *http://client1.host.com/client1 http://client1.host.com/client1*
 same way if I enter *http://client2.host.com http://client2.host.com *it
 should forward to to

 *http://client2.host.com/client2 http://client2.host.com/client2*

 *I am not interested to use virtual host in tomcat, as well as http
apache*
 whether its possible ???

Many people use a filter to accomplish this;
http://tuckey.org/urlrewrite/is the most popular.

 - Chuck

I am confused about installation part please help me, installation guide
says its WEB-INF directory which WEB-INF ?? and I didn't find any lib
directory look at the following detail, I am newbie I have lot of need of
you people's help please do the needful.


[root@peter webapps]#pwd
/usr/local/www/html/TOMCAT_DEMO/tomcat/*webapps*

[root@peter host-manager]# ls -1
docs
examples
host-manager
manager
ROOT


[root@peter host-manager]# pwd
/usr/local/www/html/TOMCAT_DEMO/tomcat/*webapps/host-manager*

[root@peter host-manager]# ls -1
images
index.jsp
manager.xml
META-INF
*WEB-INF*

[root@peter manager]#  pwd
/usr/local/www/html/TOMCAT_DEMO/tomcat/*webapps/manager*
[root@peter host-manager]#  ls -1
images
index.jsp
META-INF
status.xsd
*WEB-INF*
xform.xsl


[root@peter ROOT]# pwd
/usr/local/www/html/TOMCAT_DEMO/tomcat/*webapps/ROOT*
[root@peter host-manager]# ls -1
asf-logo.png
asf-logo-wide.gif
bg-button.png
bg-middle.png
bg-nav-item.png
bg-nav.png
bg-upper.png
build.xml
favicon.ico
index.jsp
RELEASE-NOTES.txt
tomcat.css
tomcat.gif
tomcat.png
tomcat-power.gif
tomcat.svg
*WEB-INF*



- Peter


On Sat, Dec 28, 2013 at 6:48 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Peter [mailto:nex@gmail.com]
  Subject: tomcat - How to forward request to some webapp while using port
 80 without virtual host, without apache

  if I enter *http://client1.host.com http://client1.host.com* on
 browser,
  then tomcat should forward it to webapp client1

  *http://client1.host.com/client1 http://client1.host.com/client1*
  same way if I enter *http://client2.host.com http://client2.host.com
 *it
  should forward to to

  *http://client2.host.com/client2 http://client2.host.com/client2*

  *I am not interested to use virtual host in tomcat, as well as http
 apache*
  whether its possible ???

 Many people use a filter to accomplish this; http://tuckey.org/urlrewrite/is 
 the most popular.

  - 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




Re: tomcat - How to forward request to some webapp while using port 80 without virtual host, without apache

2013-12-28 Thread André Warnier

Peter wrote:

Hi all, I have many entries in /etc/hosts file, like this

cat /etc/hosts
127.0.0.1 main.host.com localhost
::1localhost6.localdomain6 localhost6
a.b.c.d client1.host.com hostname
a.b.c.d client1.host.com hostname

in webapp directory, webapp folders

client1
client2

my tomcat uses port 80, so by default when I enter any of above hostname on
browser I could see default index page, but my interest is like below

if I enter *http://client1.host.com http://client1.host.com* on browser,
then tomcat should forward it to webapp client1

*http://client1.host.com/client1 http://client1.host.com/client1*
same way if I enter *http://client2.host.com http://client2.host.com *it
should forward to to


*http://client2.host.com/client2 http://client2.host.com/client2*
How this can be achieved



*I am not interested to use virtual host in tomcat,


The question here would be : why not ?
Because that is the usual (and most natural) way of doing the kind of thing 
that you want.

Other than virtual hosts, you can do as Chuck suggests, and use a servlet filter in the 
ROOT webapp to re-direct, but it is almost guaranteed to give you headaches later on, when 
your pages will contain self-referencing URLs and the like.
Or else, it will be very inefficient, because you will have 2 round-trips to the browser 
for each access.



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



Re: tomcat - How to forward request to some webapp while using port 80 without virtual host, without apache

2013-12-28 Thread André Warnier

Peter wrote:
...



I am confused about installation part please help me, installation guide
says its WEB-INF directory which WEB-INF ?? and I didn't find any lib
directory look at the following detail, I am newbie I have lot of need of
you people's help please do the needful.



Maybe you could start here :

http://tomcat.apache.org/tomcat-7.0-doc/index.html
1, 2, 3 etc..

This is not a joke.  If really you do not know what WEB-INF stands for, and you really 
want to achieve what is in the subject of this thread, you do need to read on some basics.


On this list, we do what we can to help people with Tomcat problems or 
questions.
But this does not really replace some basic knowledge about Servlet Engines in general, 
and Tomcat in particular.


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



Re: tomcat - How to forward request to some webapp while using port 80 without virtual host, without apache

2013-12-28 Thread Peter
I am happy that you guys sent reply to me, but anyone here can create
configuration file for me for example which I had mentioned in beginning of
post, then I can understand better, its my weakness but true.

-Peter

On Sat, Dec 28, 2013 at 10:25 PM, André Warnier a...@ice-sa.com wrote:

 Peter wrote:
 ...



 I am confused about installation part please help me, installation guide
 says its WEB-INF directory which WEB-INF ?? and I didn't find any lib
 directory look at the following detail, I am newbie I have lot of need of
 you people's help please do the needful.


 Maybe you could start here :

 http://tomcat.apache.org/tomcat-7.0-doc/index.html
 1, 2, 3 etc..

 This is not a joke.  If really you do not know what WEB-INF stands for,
 and you really want to achieve what is in the subject of this thread, you
 do need to read on some basics.

 On this list, we do what we can to help people with Tomcat problems or
 questions.
 But this does not really replace some basic knowledge about Servlet
 Engines in general, and Tomcat in particular.


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




Re: tomcat - How to forward request to some webapp while using port 80 without virtual host, without apache

2013-12-28 Thread Mark Eggers

On 12/28/2013 11:00 PM, Peter wrote:

I am happy that you guys sent reply to me, but anyone here can create
configuration file for me for example which I had mentioned in beginning of
post, then I can understand better, its my weakness but true.

-Peter

On Sat, Dec 28, 2013 at 10:25 PM, André Warnier a...@ice-sa.com wrote:


Peter wrote:
...




I am confused about installation part please help me, installation guide
says its WEB-INF directory which WEB-INF ?? and I didn't find any lib
directory look at the following detail, I am newbie I have lot of need of
you people's help please do the needful.



Maybe you could start here :

http://tomcat.apache.org/tomcat-7.0-doc/index.html
1, 2, 3 etc..

This is not a joke.  If really you do not know what WEB-INF stands for,
and you really want to achieve what is in the subject of this thread, you
do need to read on some basics.

On this list, we do what we can to help people with Tomcat problems or
questions.
But this does not really replace some basic knowledge about Servlet
Engines in general, and Tomcat in particular.


Here are step by step instructions for setting up virtual hosts with 
Tomcat. It's a bit out of date (shoot me, maybe next month), but the 
server.xml fragments will work in the latest 7.0.x environment.


http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts

. . . just my (too few hours and too much writing) two cents
/mde/


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