Skip to Content
author's profile photo Former Member
Former Member

Apache configuration to proxy pass HTTP and HTTP(S) yacceleratorstorefront (electronic store) URL to Hybris Server

I am trying to access the yacceleratorstorefront/electronics/en/?site=electronics URL using apache web server which will proxy to Hybris. The hybris server has electronic store URL configured & is working localhost without any issues. The electronic store URL is accessible directly from any of the server in environment if apache web server is BY PASSED, but this is NOT what I want.

Summary:

private server (browse http&httpS) --> hybris server = working

private server(browse http & httpS) --> apache --> hybris server(9001&9002) = NOT working

Note: http://10.0.1.141:9001 is my Hybris server.

ERROR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

HTTP Status 500 - Cannot find CMSSite associated with current URL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

type Status report

message Cannot find CMSSite associated with current URL

description The server encountered an internal error that prevented it from fulfilling this request.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Any suggestion or advice is highly appreciated. Thank you in advance.

-Regards, S@BS

------------------------------------------------httpd Code below----------------------------------------------------

<VirtualHost *:80> ProxyPreserveHost On

ProxyPass / http://10.0.1.141:9001/yacceleratorstorefront/electronics/en/?site=electronics ProxyPassReverse / http://10.0.1.141:9001/yacceleratorstorefront/electronics/en/?site=electronics

ServerName localhost </VirtualHost>

<VirtualHost *:443> ServerName localhost

#ProxyRequests Off #ProxyPreserveHost On ProxyPass / https://10.0.1.141:9002/yacceleratorstorefront/electronics/en/?site=electronics ProxyPassReverse / https://10.0.1.141:9002/yacceleratorstorefront/electronics/en/?site=electronics

SSLEngine on SSLCertificateFile /etc/httpd/certs/mysite.com.crt SSLCertificateKeyFile /etc/httpd/certs/mysite.com.key

</VirtualHost>

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 04, 2015 at 03:50 PM

    You need to look at the access log of hybris. If you're getting the CMS error, likely it's not receiving the ?site=electronics parameter.

    If we can see what's being received by hybris it may help understand what's going on.

    There are a lot of ways to get around this, like using the hostname and editing your hosts file. But generally there are many issues with this configuration. You should typically not forward https from Apache to hybris https. You should send http clear, so your https virtual host should actually proxy to 9001, but then you have to add some headers to tell hybris that the source request was secure.

    See this: http://serverfault.com/questions/505316/ssl-setup-with-apache-in-front-of-tomcat

    Lots of docs already explain how to do that.

    Lastly I would recommend using mod_ajp_proxy instead of http proxy, but that's not absolutely required.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2015 at 12:58 PM

    were you able to go thru the log file?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 10, 2015 at 10:14 PM

    You are not able to hide the context path behind the proxy like as you have presented above as you would run into other issues. Your problem is that you proxypass / to /yacceleratorstorefront?.... You can either change your storefront webroot in tomcat or create a redirect in apache from ^/$ to /yacceleratorstorefront?site=electronics

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.