1

I am using Apache on Linux to proxy all requests to the site to tomcat, so that I can use virtual hosting and use https. My webapp in tomcat is /epub but I set up apache proxypass and proxypassreverse to map / to http//localhost:8081/epub/

I do all of this so that I can login to my website via facebook.

(NOTE: this is not a real site and I had to set up /etc/hosts and apache virtual hosting for my sitename that I registered with facebook.)

In tomcat server.xml I set the Connector element as follows:

<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"
       proxyPort="80"
       proxyName="andyssite2.com"/>

But did not set anything for executor shared thread pool for this port.

Here's what's not working:

bug 1) when I go to my loginservlet, I check if a session exists. If not I create one and save the "hash" request parameter as an attribute of the session. Then redirect to facebook per their OAuth server flow scheme. When facebook redirects back to my loginservlet, the HttpSession exists, but the "hash" attribute is lost. (I would rather save in the session than in a cookie.)

bug 2) I then get the rest of facebook user info, and redirect to "/index.html". The browser shows my url as "http://andyssite2.com/index.html#_=_" and this causes problems because my javascript loaded by index.html is not prepared for the hash _=_ that somehow comes into play. I also tried redirecting to my site using an absolute url and got the same problem with the hash of _=_ and my question is what is causing this spurios hash to get added.

I have the latest apache for Centos6.

Andy

1 Answer 1

1

I have very similar configuration with apache as front-end and tomcat behind it running liferay portal (Also running CentOS).

Best way I found with research is to use mod_proxy_ajp:

httpd.conf:

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
ProxyPass / ajp://localhost:8009/

server.xml:

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

You can apply your config over mine, I hope this fix your issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.