on 01-05-2016 1:32 PM
Hello
We use NWBC for HTML and MIM.
We have a webserver with an Apache running that connects to multiple SAP-ECC backend systems.
We want to use only one domain, http://www.mydomain.com/ to connect to the webserver, and change the url to point to the backends.
http://www.mydomain.com/dir1/ ---> http://localhost1:8000/nwbc
http://www.mydomain.com/dir2/ ---> http://localhost2:8000/nwbc
In both backend systems we have created an alias in SICF for nwbc:
/dir1 -> /default_host/sap/bc/nwbc
/dir2 -> /default_host/sap/bc/nwbc
In Apache we wrote:
ServerName www.mydomain.com
ProxyPass /dir1 http://localhost1:8000/
ProxyPassReverse /dir1 http://localhost1:8000/
ProxyPass /dir2 http://localhost2:8000/
ProxyPassReverse /dir2 http://localhost2:8000/
-> It does not work, the problem seems to be that SAP publishes pages with internal links to "/sap/public/bc/...." and the final URL is like http://www.mydomain.com/sap/public/bc...", so the proxypass fails.
How can we solve this problem?
Is it possible to specify in each SAP-ECC backend that links should be created as:
"/dir1/sap/public/bc/...."
"/dir2/sap/public/bc/...."
We've tried to create an alias in SICF for /sap directory but it does not work.
Any help, please?
Hi Xavier -
I'm curious... what's the reason for your requirement to use only one domain? I'm assuming it's for the sake of single sign-on with SAP logon tickets, which can't cross DNS domains. If so, you can achieve your intended result with a much more simple design, in my opinion.
**I preface this recommendation by admitting I know very little of your overall architecture**
Rather than using virtual resources (eg: /dir1, /dir2) defined on a single virtual host (eg: www.mydomain.com). it would be better to use Apache's mod_rewrite, rather than mod_proxy like you're using now. By doing so, you could use multiple named virtual hosts in Apache, all of which belong to the same parent domain. For example, the following hosts could be defined in your .CONF files in Apache:
****************************************************************
<VirtualHost 10.11.12.20:80>
DocumentRoot /var/www/html/host_one
ServerName hostone.mydomain.edu
ServerAlias realhostname1.realdomain.com
ErrorLog logs/host_one_error_log
TransferLog logs/host_one_access_log
ProxyPreserveHost on
</VirtualHost>
<VirtualHost 10.11.12.20:80>
DocumentRoot /var/www/html/host_two
ServerName hosttwo.mydomain.edu
ServerAlias realhostname2.realdomain.com
ErrorLog logs/host_two_error_log
TransferLog logs/host_two_access_log
ProxyPreserveHost on
</VirtualHost>
...etc.
****************************************************************
Admittedly, these names are overly-generic but I think the example convey the basic idea. IP address remains constant as that's the Apache server, document root is unique for each VirtualHost. ServerAlias remains constant as this is the real host name of this Apache server. ServerName is unique for each VirtualHost and you'd make a DNS entry in your corporate name servers to route traffic addressed to these virtual aliases to this Apache server.
You would then define your rewrite statements in .htaccess files in the document root of each host (note that document root is defined in the VirtualHost definition above). Those statements can beas simple as the following:
****************************************************************
RewriteEngine On
#
RewriteCond %{SERVER_NAME} ^hostone.mydomain.edu*
RewriteRule ^(.*) http://realhostnameECC1.realdomain.com:8000/$1 [R,NE,QSA,P]
#
****************************************************************
So in the example above, if you entered the following URL in your browser, you'd get to NWBC on ECC1:
http://hostone.mydomain.com/sap/bc/nwbc
Same goes for all other hosts you define. Because they all exist (virtually) in child namespaces of the parent mydomain.com namespace, you SAP logon tickets work just fine. There would be no configuration needed on the ECC systems to support this reverse proxy architecture.
That's how I'd do it, at least.
<KC>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.