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: Apache 2.4 SAP Fiori Custom CSS not rewritten
Author
Phippsy2900



Joined: 17 Mar 2015
Posts: 5
Location: United Kingdom, Bristol

PostPosted: Wed 18 Mar '15 13:07    Post subject: Apache 2.4 SAP Fiori Custom CSS not rewritten Reply with quote

I've been asked to put an Apache Reverse Proxy in place as per guidance from SAP - http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e0537a-a1a4-3210-758e-9449c61e23a3?QuickLink=index&overridelayout=true&59983513260662 - but have come across an issue where the CSS file is not rewritten by the reverse proxy. The below is the Virtual Hosts entry from the test httpd.conf that i'm running to get it working. I'll be moving this to vhosts entries when it eventually works (optimism slowly vanishing! Very Happy).

Listen 443
<VirtualHost *:443>
SSLEngine On
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
AllowEncodedSlashes On
SSLCertificateFile /Apache24/conf/FILE.crt
SSLCertificateKeyFile /Apache24/conf/KEYFILE.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
ServerName Gateway.External.co.uk
ProxyPass / http://SAPGateway.Internal:8010/ nocanon
ProxyPassReverse / http://SAPGateway.Internal:8010/
ErrorLog "C:/Apache24/logs/error.log"
TransferLog "C:/Apache24/logs/access.log"
</VirtualHost>

Each post I come across with a similar issue mentions the trailing '/' on the ProxyPass entries, unfortunately - for me - they're there! Sad

I'm new to Apache, but willing to learn so any help would be very gratefully received.

Kind Regards
Back to top
James Blond
Moderator


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

PostPosted: Wed 18 Mar '15 14:30    Post subject: Reply with quote

Did you use a tool like firebug or so to see which URL is requested for the CSS file?
Back to top
Phippsy2900



Joined: 17 Mar 2015
Posts: 5
Location: United Kingdom, Bristol

PostPosted: Wed 18 Mar '15 14:52    Post subject: Reply with quote

I've used Fiddler and get a 502 for the Get Request of this css page. The WebView shows that there's a DNS lookup failure because it's pointing to the internal server name and not the reverse address.

From the client machine, if I take the CSS path and append it to the external address I can load the CSS - as a file - without issue.
Back to top
James Blond
Moderator


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

PostPosted: Wed 18 Mar '15 15:13    Post subject: Reply with quote

Ah, ok! So you need to use mod_proxy_html or mod_sed to change the domain name.
Back to top
Phippsy2900



Joined: 17 Mar 2015
Posts: 5
Location: United Kingdom, Bristol

PostPosted: Wed 18 Mar '15 15:20    Post subject: Reply with quote

Mod_Proxy_HTML and Mod_Sed are enabled, would this need an expression to capture the URL?

Is there something I can read to work this out, i'm not a fan of regular expressions! Sad
Back to top
James Blond
Moderator


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

PostPosted: Wed 18 Mar '15 15:22    Post subject: Reply with quote

For mod_sed there is a good tutorial http://httpd.apache.org/docs/2.4/mod/mod_sed.html

if you still have a question please ask again.
Back to top
Phippsy2900



Joined: 17 Mar 2015
Posts: 5
Location: United Kingdom, Bristol

PostPosted: Wed 18 Mar '15 15:37    Post subject: Reply with quote

So.

AddOutputFilter Sed html
OutputSed "s/InternalAddress/ExternalAddres/g"

It can't be that simple...can it?

Edited to add:

External address is https, internal is http. Confused
Back to top
Phippsy2900



Joined: 17 Mar 2015
Posts: 5
Location: United Kingdom, Bristol

PostPosted: Wed 18 Mar '15 16:18    Post subject: Reply with quote

No, it appears not.

I have


http://InternalServer.Domain.com:8888/Characters/asdfasdf/cssfile.css

Needing to get to.

https://ExternalServer.Domain.com/Characters/asdfasdf/cssfile.css

But using

AddOutputFiler Sed html
OutputSed "/s/testing/Test/g"

Doesn't let me start Apache.

I put it inside <Directory /></Directory> tags which lets me start Apache, but I am still not seeing the contents amended in Fiddler.

I used
AddOutputFilter Sed html
OutputSed "s/ServerName/Website/g"

As a test but haven't seen any changes. Am I thinking about this the wrong way?
Back to top
James Blond
Moderator


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

PostPosted: Wed 18 Mar '15 18:05    Post subject: Reply with quote

O_o what is ... not so good

with mod_proxy_html

Code:

ProxyHTMLEnable On
ProxyHTMLURLMap http://InternalServer.Domain.com:8888 https://ExternalServer.Domain.com
Back to top


Reply to topic   Topic: Apache 2.4 SAP Fiori Custom CSS not rewritten View previous topic :: View next topic
Post new topic   Forum Index -> Apache