logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Redirecting to multiple webapps in same Tomcat
Author
gdosaigues



Joined: 25 Jun 2015
Posts: 2

PostPosted: Thu 25 Jun '15 10:01    Post subject: Redirecting to multiple webapps in same Tomcat Reply with quote

I must say that I tried a lot of possibilities but my knowledgment in Apache WS is not too much advanced.

Apache Web Server version: 2.2.22
OS: Centos 6 64 bits
Tomcat version: 7.0.57

What I need to achieve is the following:
I have some plain websites defined this way:
<VirtualHost *:80>
ServerAdmin example1@example1.com
DocumentRoot "/opt/sites/example1/"
ServerName example1.com
ErrorLog logs/example1-error_log
CustomLog logs/example1-access_log common
RedirectMatch permanent ^/(.*) http://www.example1.com/$1
</VirtualHost>
<VirtualHost *:80>
ServerAdmin example1@example1.com
DocumentRoot "/opt/sites/example1/"
ServerName www.example1.com
ErrorLog logs/example1-error_log
CustomLog logs/example1-access_log common
</VirtualHost>


I have a tomcat with several webapps, each one accessible by its own context.
I must access each one of this webapps from a different domain. For example, I have the following webapps: wbExample1, wbExample2, wbExample3

It should be accessible this way:

www.example1.com/wbExample1
www.example2.com/wbExample2
www.example3.com/wbExample3

So, the domain defined for each website must also access to an specific webapp.

For an extra, I would like to know if www.example1.com/wbExample1 could be accessible with url www.example1.com/contact without showing the name context of the webapp and showing the text contact or contact.html.

I think I explained it quite clear. If you need some more information please, don't hesitate to ask me.
Thank you very much for your time.
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Fri 26 Jun '15 11:37    Post subject: Reply with quote

Already answered at the Apache user list.

Last edited by admin on Fri 26 Jun '15 11:59; edited 2 times in total
Back to top
gdosaigues



Joined: 25 Jun 2015
Posts: 2

PostPosted: Fri 26 Jun '15 11:41    Post subject: Reply with quote

What's answered in the Apache user list is not enough. As you can see I replied to Serge telling him that I know what to use, but what I need is somebody that can explain it to me with an example.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 26 Jun '15 17:03    Post subject: Reply with quote

I and most forum users do not follow the user list...
can you post the answer in pastebin?

What question is left?
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Fri 26 Jun '15 17:27    Post subject: Reply with quote

http://www.gossamer-threads.com/lists/apache/users/448212
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Mon 29 Jun '15 11:36    Post subject: Reply with quote

Of cause you need 3 vhosts Wink

inside a vhost it can be like

Code:

    <Location />
        ProxyPass ajp://localhost:8009/
        ProxyPassReverse ajp://localhost:8009/
    </Location>
Back to top


Reply to topic   Topic: Redirecting to multiple webapps in same Tomcat View previous topic :: View next topic
Post new topic   Forum Index -> Apache