You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Monika Solanki <ms...@gmail.com> on 2012/01/26 05:56:15 UTC

Redirecting apache http requests to tomcat application running on 8080

I am using tomcat 7.x. I would like to redirect requests to a site on
apache, port 80 to one of my application running on tomcat, localhost:8080.
I have set up the proxy and reverse proxy to redirect the request and this
is working. However the application on tomcat is associated with an xsl
file which is not being resolved with the redirect. This cause the browser
to throw an exception when the site is requested on apache. How do I solve
this problem.

Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Luciano Andress Martini <77...@gmail.com>.
ummm im really sorry =[


2012/1/27, André Warnier <aw...@ice-sa.com>:
> Luciano Andress Martini wrote:
>> For facility your understaing, you can do exactly that:
>>
>> Apache Front:
>> http://data.example.com
>>
>> Edit the configuration of the VirtualHost for this domain, example:
>>
>> /etc/apache2/sites-enable/000-default
>> <VirtualHost *:443>
>> #ServerName data.example.com
>> ProxyRequests Off
>> ProxyPreserveHost On
>> RewriteEngine On
>>
>> ProxyPass / http://some_ip:8080/
>> ProxyPassReverse / http://some_ip:8080/
>>
>
> Luciano,
>
> it is very nice of you to want to help another user on the list.
> But maybe you should really read and understand the problem first.
> Monika's problem is not with proxying per se, nor with SSL.
> It is with a link to an XSL document, inside a page returned by her Tomcat
> application.
>
> André
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: Redirecting apache http requests to tomcat application running on 8080

Posted by André Warnier <aw...@ice-sa.com>.
Luciano Andress Martini wrote:
> For facility your understaing, you can do exactly that:
> 
> Apache Front:
> http://data.example.com
> 
> Edit the configuration of the VirtualHost for this domain, example:
> 
> /etc/apache2/sites-enable/000-default
> <VirtualHost *:443>
> #ServerName data.example.com
> ProxyRequests Off
> ProxyPreserveHost On
> RewriteEngine On
> 
> ProxyPass / http://some_ip:8080/
> ProxyPassReverse / http://some_ip:8080/
> 

Luciano,

it is very nice of you to want to help another user on the list.
But maybe you should really read and understand the problem first.
Monika's problem is not with proxying per se, nor with SSL.
It is with a link to an XSL document, inside a page returned by her Tomcat application.

André


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


Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Luciano Andress Martini <77...@gmail.com>.
For facility your understaing, you can do exactly that:

Apache Front:
http://data.example.com

Edit the configuration of the VirtualHost for this domain, example:

/etc/apache2/sites-enable/000-default
<VirtualHost *:443>
#ServerName data.example.com
ProxyRequests Off
ProxyPreserveHost On
RewriteEngine On

ProxyPass / http://some_ip:8080/
ProxyPassReverse / http://some_ip:8080/



2012/1/27, Luciano Andress Martini <77...@gmail.com>:
> If you want to tunnel a connection to one apache to an internal tomcat
> server you can with that:
>
> Open a config file from a site like
> /etc/apache2/sites-available/000-default and put this:
>
> ProxyPass /est http://192.168.3.38:8080/est
> ProxyPassReverse /est http://192.168.3.38:8080/est
>
> =]
>
> This is very interesting because you can use ssl on apache only.
>
>
> 2012/1/27, Monika Solanki <ms...@gmail.com>:
>> On Thu, Jan 26, 2012 at 2:45 PM, Pid <pi...@pidster.com> wrote:
>>
>>> On 26/01/2012 08:50, Monika Solanki wrote:
>>> > On Thu, Jan 26, 2012 at 8:34 AM, Pid <pi...@pidster.com> wrote:
>>> >
>>> >> On 26/01/2012 04:56, Monika Solanki wrote:
>>> >>> I am using tomcat 7.x. I would like to redirect requests to a site
>>> >>> on
>>> >>> apache, port 80 to one of my application running on tomcat,
>>> >> localhost:8080.
>>> >>
>>> >> Please tell us exactly which version of Tomcat (and anything else
>>> >> that's
>>> >> relevant, e.g. HTTPD), or we may incorrectly assume the wrong one.
>>> >> There are now 25 versions of Tomcat 7.0.
>>> >>
>>> >
>>> > My Tomcat version is 7.0.22
>>> >
>>> >>
>>> >>> I have set up the proxy and reverse proxy to redirect the request
>>> >>> and
>>> >> this
>>> >>> is working. However the application on tomcat is associated with an
>>> >>> xsl
>>> >>> file which is not being resolved with the redirect. This cause the
>>> >> browser
>>> >>> to throw an exception when the site is requested on apache. How do I
>>> >> solve
>>> >>> this problem.
>>> >>
>>> >> The browser throws an exception or Tomcat does?
>>> >>
>>> >
>>> > The browser complains of not finding the transformation file, but the
>>> page
>>> > is being rendered by Tomcat, i.e., it is a dynamic page being
>>> > generated
>>> by
>>> > Tomcat but the page uses the xsl file which is in one of the folders
>>> > of
>>> the
>>> > application folder in webapps of Tomcat.
>>> >
>>> > Thanks
>>>
>>> >> Where is the XSL file and which part of the system needs to access
>>> >> it?
>>>
>>
>> The apache front is http://data.example.com
>>  tomcat app is : http://localhost:8080/myapp
>>
>> tomcat app deployed in <tomcat>/webapps/myapp
>> myapp uses transformation file, text.xsl,  in the folder
>> <tomcat>/webapps/myapp/transformation
>>
>> The page that is displayed when  http://localhost:8080/myapp is called
>> uses
>> the xsl transformation.
>>
>> The proxy and reverse proxy pass in the virtual host for
>> http://data.example.com  have been set to
>>
>> /endpoint  http://localhost:8080/myapp
>>
>> I would like http://data.example.com/endpoint to get redirected to
>> http://localhost:8080/myapp
>>
>> When tomcat sends back the response, the page looks for the
>> transformation
>> file, http://data.example.com/transformation/test.xsl and of course
>> cannot
>> find it.
>>
>> Everything works smoothly under tomcat
>>
>> Thanks
>>
>>>
>>> Where exactly is the XSL file - what is its exact path?
>>>
>>> Where is the code that needs the XSL file?
>>>
>>> What URL is that code using to access the file?
>>>
>>> Does it work if you connect directly to Tomcat, rather than using the
>>> proxy?
>>>
>>>
>>> p
>>>
>>> >> For example, is Tomcat rendering the output or is the browser
>>> >> rendering
>>> it?
>>> >>
>>> >>
>>> >> p
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >> [key:62590808]
>>> >>
>>> >>
>>> >
>>>
>>>
>>> --
>>>
>>> [key:62590808]
>>>
>>>
>>
>

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


Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Luciano Andress Martini <77...@gmail.com>.
If you want to tunnel a connection to one apache to an internal tomcat
server you can with that:

Open a config file from a site like
/etc/apache2/sites-available/000-default and put this:

ProxyPass /est http://192.168.3.38:8080/est
ProxyPassReverse /est http://192.168.3.38:8080/est

=]

This is very interesting because you can use ssl on apache only.


2012/1/27, Monika Solanki <ms...@gmail.com>:
> On Thu, Jan 26, 2012 at 2:45 PM, Pid <pi...@pidster.com> wrote:
>
>> On 26/01/2012 08:50, Monika Solanki wrote:
>> > On Thu, Jan 26, 2012 at 8:34 AM, Pid <pi...@pidster.com> wrote:
>> >
>> >> On 26/01/2012 04:56, Monika Solanki wrote:
>> >>> I am using tomcat 7.x. I would like to redirect requests to a site on
>> >>> apache, port 80 to one of my application running on tomcat,
>> >> localhost:8080.
>> >>
>> >> Please tell us exactly which version of Tomcat (and anything else
>> >> that's
>> >> relevant, e.g. HTTPD), or we may incorrectly assume the wrong one.
>> >> There are now 25 versions of Tomcat 7.0.
>> >>
>> >
>> > My Tomcat version is 7.0.22
>> >
>> >>
>> >>> I have set up the proxy and reverse proxy to redirect the request and
>> >> this
>> >>> is working. However the application on tomcat is associated with an
>> >>> xsl
>> >>> file which is not being resolved with the redirect. This cause the
>> >> browser
>> >>> to throw an exception when the site is requested on apache. How do I
>> >> solve
>> >>> this problem.
>> >>
>> >> The browser throws an exception or Tomcat does?
>> >>
>> >
>> > The browser complains of not finding the transformation file, but the
>> page
>> > is being rendered by Tomcat, i.e., it is a dynamic page being generated
>> by
>> > Tomcat but the page uses the xsl file which is in one of the folders of
>> the
>> > application folder in webapps of Tomcat.
>> >
>> > Thanks
>>
>> >> Where is the XSL file and which part of the system needs to access it?
>>
>
> The apache front is http://data.example.com
>  tomcat app is : http://localhost:8080/myapp
>
> tomcat app deployed in <tomcat>/webapps/myapp
> myapp uses transformation file, text.xsl,  in the folder
> <tomcat>/webapps/myapp/transformation
>
> The page that is displayed when  http://localhost:8080/myapp is called uses
> the xsl transformation.
>
> The proxy and reverse proxy pass in the virtual host for
> http://data.example.com  have been set to
>
> /endpoint  http://localhost:8080/myapp
>
> I would like http://data.example.com/endpoint to get redirected to
> http://localhost:8080/myapp
>
> When tomcat sends back the response, the page looks for the transformation
> file, http://data.example.com/transformation/test.xsl and of course cannot
> find it.
>
> Everything works smoothly under tomcat
>
> Thanks
>
>>
>> Where exactly is the XSL file - what is its exact path?
>>
>> Where is the code that needs the XSL file?
>>
>> What URL is that code using to access the file?
>>
>> Does it work if you connect directly to Tomcat, rather than using the
>> proxy?
>>
>>
>> p
>>
>> >> For example, is Tomcat rendering the output or is the browser rendering
>> it?
>> >>
>> >>
>> >> p
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> [key:62590808]
>> >>
>> >>
>> >
>>
>>
>> --
>>
>> [key:62590808]
>>
>>
>

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


Re: Redirecting apache http requests to tomcat application running on 8080

Posted by André Warnier <aw...@ice-sa.com>.
Monika Solanki wrote:
> Hi Andre,
> 
> The link to the xsl file in the page is
> 
> <?xml-stylesheet type='text/xsl' href='/myapp/transformation/test.xsl'?>
> 
Ok, so what you say below is not correct.

The browser is looking for "http://data.example.com/myapp/transformation/test.xsl".

And the server at "http://data.example.com" only proxies to Tomcat, the URLs which start 
with "/endpoint".  It does not proxy a URL which starts with "/myapp".

One solution : in your original page under Tomcat, change the href to the stylesheet.
Instead of having : href="/myapp/transformation/test.xsl"
change it to : href="transformation/test.xsl"

Then report what it does.

> 
> 
> 
> 
> On Fri, Jan 27, 2012 at 4:43 PM, André Warnier <aw...@ice-sa.com> wrote:
> 
>> Monika Solanki wrote:
>> ...
>>
>>
>>> When tomcat sends back the response, the page looks for the transformation
>>> file, http://data.example.com/**transformation/test.xsl<http://data.example.com/transformation/test.xsl>and of course cannot
>>> find it.
>>>
>>>  Monika,
>> tell us *exactly* how the link to the XSL file is, in the html page that
>> the browser receives.  Open the "source" of the page in the browser, find
>> the reference to the XSL, and copy and paste the tag here.
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


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


Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Monika Solanki <ms...@gmail.com>.
Hi Andre,

The link to the xsl file in the page is

<?xml-stylesheet type='text/xsl' href='/myapp/transformation/test.xsl'?>





On Fri, Jan 27, 2012 at 4:43 PM, André Warnier <aw...@ice-sa.com> wrote:

> Monika Solanki wrote:
> ...
>
>
>> When tomcat sends back the response, the page looks for the transformation
>> file, http://data.example.com/**transformation/test.xsl<http://data.example.com/transformation/test.xsl>and of course cannot
>> find it.
>>
>>  Monika,
>
> tell us *exactly* how the link to the XSL file is, in the html page that
> the browser receives.  Open the "source" of the page in the browser, find
> the reference to the XSL, and copy and paste the tag here.
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Redirecting apache http requests to tomcat application running on 8080

Posted by André Warnier <aw...@ice-sa.com>.
Monika Solanki wrote:
...
> 
> When tomcat sends back the response, the page looks for the transformation
> file, http://data.example.com/transformation/test.xsl and of course cannot
> find it.
> 
Monika,

tell us *exactly* how the link to the XSL file is, in the html page that the browser 
receives.  Open the "source" of the page in the browser, find the reference to the XSL, 
and copy and paste the tag here.


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


Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Monika Solanki <ms...@gmail.com>.
On Thu, Jan 26, 2012 at 2:45 PM, Pid <pi...@pidster.com> wrote:

> On 26/01/2012 08:50, Monika Solanki wrote:
> > On Thu, Jan 26, 2012 at 8:34 AM, Pid <pi...@pidster.com> wrote:
> >
> >> On 26/01/2012 04:56, Monika Solanki wrote:
> >>> I am using tomcat 7.x. I would like to redirect requests to a site on
> >>> apache, port 80 to one of my application running on tomcat,
> >> localhost:8080.
> >>
> >> Please tell us exactly which version of Tomcat (and anything else that's
> >> relevant, e.g. HTTPD), or we may incorrectly assume the wrong one.
> >> There are now 25 versions of Tomcat 7.0.
> >>
> >
> > My Tomcat version is 7.0.22
> >
> >>
> >>> I have set up the proxy and reverse proxy to redirect the request and
> >> this
> >>> is working. However the application on tomcat is associated with an xsl
> >>> file which is not being resolved with the redirect. This cause the
> >> browser
> >>> to throw an exception when the site is requested on apache. How do I
> >> solve
> >>> this problem.
> >>
> >> The browser throws an exception or Tomcat does?
> >>
> >
> > The browser complains of not finding the transformation file, but the
> page
> > is being rendered by Tomcat, i.e., it is a dynamic page being generated
> by
> > Tomcat but the page uses the xsl file which is in one of the folders of
> the
> > application folder in webapps of Tomcat.
> >
> > Thanks
>
> >> Where is the XSL file and which part of the system needs to access it?
>

The apache front is http://data.example.com
 tomcat app is : http://localhost:8080/myapp

tomcat app deployed in <tomcat>/webapps/myapp
myapp uses transformation file, text.xsl,  in the folder
<tomcat>/webapps/myapp/transformation

The page that is displayed when  http://localhost:8080/myapp is called uses
the xsl transformation.

The proxy and reverse proxy pass in the virtual host for
http://data.example.com  have been set to

/endpoint  http://localhost:8080/myapp

I would like http://data.example.com/endpoint to get redirected to
http://localhost:8080/myapp

When tomcat sends back the response, the page looks for the transformation
file, http://data.example.com/transformation/test.xsl and of course cannot
find it.

Everything works smoothly under tomcat

Thanks

>
> Where exactly is the XSL file - what is its exact path?
>
> Where is the code that needs the XSL file?
>
> What URL is that code using to access the file?
>
> Does it work if you connect directly to Tomcat, rather than using the
> proxy?
>
>
> p
>
> >> For example, is Tomcat rendering the output or is the browser rendering
> it?
> >>
> >>
> >> p
> >>
> >>
> >>
> >>
> >> --
> >>
> >> [key:62590808]
> >>
> >>
> >
>
>
> --
>
> [key:62590808]
>
>

Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Pid <pi...@pidster.com>.
On 26/01/2012 08:50, Monika Solanki wrote:
> On Thu, Jan 26, 2012 at 8:34 AM, Pid <pi...@pidster.com> wrote:
> 
>> On 26/01/2012 04:56, Monika Solanki wrote:
>>> I am using tomcat 7.x. I would like to redirect requests to a site on
>>> apache, port 80 to one of my application running on tomcat,
>> localhost:8080.
>>
>> Please tell us exactly which version of Tomcat (and anything else that's
>> relevant, e.g. HTTPD), or we may incorrectly assume the wrong one.
>> There are now 25 versions of Tomcat 7.0.
>>
> 
> My Tomcat version is 7.0.22
> 
>>
>>> I have set up the proxy and reverse proxy to redirect the request and
>> this
>>> is working. However the application on tomcat is associated with an xsl
>>> file which is not being resolved with the redirect. This cause the
>> browser
>>> to throw an exception when the site is requested on apache. How do I
>> solve
>>> this problem.
>>
>> The browser throws an exception or Tomcat does?
>>
> 
> The browser complains of not finding the transformation file, but the page
> is being rendered by Tomcat, i.e., it is a dynamic page being generated by
> Tomcat but the page uses the xsl file which is in one of the folders of the
> application folder in webapps of Tomcat.
> 
> Thanks

>> Where is the XSL file and which part of the system needs to access it?

Where exactly is the XSL file - what is its exact path?

Where is the code that needs the XSL file?

What URL is that code using to access the file?

Does it work if you connect directly to Tomcat, rather than using the proxy?


p

>> For example, is Tomcat rendering the output or is the browser rendering it?
>>
>>
>> p
>>
>>
>>
>>
>> --
>>
>> [key:62590808]
>>
>>
> 


-- 

[key:62590808]


Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Monika Solanki <ms...@gmail.com>.
On Thu, Jan 26, 2012 at 8:34 AM, Pid <pi...@pidster.com> wrote:

> On 26/01/2012 04:56, Monika Solanki wrote:
> > I am using tomcat 7.x. I would like to redirect requests to a site on
> > apache, port 80 to one of my application running on tomcat,
> localhost:8080.
>
> Please tell us exactly which version of Tomcat (and anything else that's
> relevant, e.g. HTTPD), or we may incorrectly assume the wrong one.
> There are now 25 versions of Tomcat 7.0.
>

My Tomcat version is 7.0.22

>
> > I have set up the proxy and reverse proxy to redirect the request and
> this
> > is working. However the application on tomcat is associated with an xsl
> > file which is not being resolved with the redirect. This cause the
> browser
> > to throw an exception when the site is requested on apache. How do I
> solve
> > this problem.
>
> The browser throws an exception or Tomcat does?
>

The browser complains of not finding the transformation file, but the page
is being rendered by Tomcat, i.e., it is a dynamic page being generated by
Tomcat but the page uses the xsl file which is in one of the folders of the
application folder in webapps of Tomcat.

Thanks

>
> Where is the XSL file and which part of the system needs to access it?
> For example, is Tomcat rendering the output or is the browser rendering it?
>
>
> p
>
>
>
>
> --
>
> [key:62590808]
>
>

Re: Redirecting apache http requests to tomcat application running on 8080

Posted by Pid <pi...@pidster.com>.
On 26/01/2012 04:56, Monika Solanki wrote:
> I am using tomcat 7.x. I would like to redirect requests to a site on
> apache, port 80 to one of my application running on tomcat, localhost:8080.

Please tell us exactly which version of Tomcat (and anything else that's
relevant, e.g. HTTPD), or we may incorrectly assume the wrong one.
There are now 25 versions of Tomcat 7.0.

> I have set up the proxy and reverse proxy to redirect the request and this
> is working. However the application on tomcat is associated with an xsl
> file which is not being resolved with the redirect. This cause the browser
> to throw an exception when the site is requested on apache. How do I solve
> this problem.

The browser throws an exception or Tomcat does?

Where is the XSL file and which part of the system needs to access it?
For example, is Tomcat rendering the output or is the browser rendering it?


p




-- 

[key:62590808]