Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
This weblog is based on the internal ITS of the 640 Web Application Server.
I suppose the same answers apply to standalone ITS but I haven't verified that.

When using an Apache reverse proxy in front of ITS content (or an Enterprise Portal
that integrates ITS content) you will find the simple ProxyPass and
ProxyPassReverse directives are not sufficient because of the way ITS URLs are formed.

ITS URLs look like this:
http://ITSHOST:PORT/sap(cz1TSUQlM2FBTk9OJTNhbHM0MDg5X0VCUV84OSUzYXlCNnhHMkswNF9OUkFyZm45RDFsSzNodElW...

The …sap(…)/ part doesn’t make it through the proxy engine and
Apache tries to serve it as a local file. You will end up with this error:

Not Found The requested URL /sap(cz1TSUQlM2FBTk9OJTNhbHM0MDg5X0VCUV84OSUzYXlCNnhHMkswNF9OUkFyZm45RDFsSzNodElWRno5VHI3eVZCeF94Z0ctQVRU)/bc/gui/sap/its/bbpsc02/~flNUQVRFPTk1NTg1NzY4Ny4wMDEuMDEuMDE= was not found on this server

There are several solutions to this problem. I’ll discuss one trivial solution and one more elegant.

First, the typical proxy rule looks like this:

ProxyPass /sap http://ITSHOST:PORT/sap ProxyPassReverse /sap http://ITSHOST:PORT/sap

The trivial solution is to change this to:
ProxyPass / http://ITSHOST:PORT/ ProxyPassReverse / http://ITSHOST:PORT/

But this proxies every request to Apache and makes using the proxy for multiple
backend systems more complicated. You can still proxy for a portal (for instance) in
this case using normal proxy directives like:

ProxyPass /irj http://EPHOST:PORT/irj ProxyPassReverse /irj http://EPHOST:PORT/irj ProxyPass /logon http://EPHOST:PORT/logon ProxyPassReverse /logon http://EPHOST:PORT/logon

But this can get complicated from an administrative standpoint as the order
these directives appear in your httpd.conf file is important. If you put
the / directive before the /irj directive then /irj will get proxied to
ITSHOST:PORT/irj. And since that host is an ITS and not a Portal then you
will surely get errors.

The better way to solve the problem is by using the Rewrite module. Enable the Rewrite module
and then use a rule like this:

RewriteRule ^/(sap\(.*) http://ITSHOST:PORT /$1 [P,L]

Place your Rewrite directives above your Proxy directives as this is the standard way
to configure Apache and allows for Apache to apply the Rewrite before the Proxy.
This rule takes care of the Apache proxy module mishandling the sap(….) form of
URLs and also allows you serve multiple backend hosts in the same Apache server.
The next problem you might face is trying to proxy two different ITS hosts from the same Apache 😉

6 Comments