1

I have the following setup: Apache running the front end (AngularJS)
Tomcat 7 Running back end (Spring MVC, Spring Security)

Apache Config

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LoadModule proxy_module libexec/apache2/mod_proxy.so LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so ProxyRequests off ProxyPreserveHost on ProxyPass /api/ ajp://132.230.166.21:8009/OntoRais/api/ ProxyPassReverse /api/ ajp://132.230.166.21:8009/OntoRais/api/ Alias /rais "/home/bwright/Repositories/ontology-toolchain/WebClient" <Directory "/home/bwright/Repositories/ontology-toolchain/WebClient"> Order allow,deny Allow from all Require all granted </Directory </VirtualHost> 

As one can see I pass all api calls to the tomcat server using the ajp protocol.

Tomcat Config (Server.xml)

Nothing changed from clean install apart from:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" enableLookups="false"/> 

Now when I try to access a tomcat resource via the front end I get 403

HTTP Status 403 - Full authentication is required to access this resource accessing /OntoRais/api/user 

In the tomcat server log I get

13:25:10.034 [ajp-bio-8009-exec-7] DEBUG o.s.s.w.s.SessionManagementFilter - Requested session ID ED0779DC647DEE3C58DEA7059C260594 is invalid. 

When accessing the same resource via the bowser directly to the tomcat server http://localhost:8080/OntoRais/api/user everything works fine.

Edit

To clarify, 132.230.166.21 is the same machine as localhost. I changed the configuration to say localhost without any change.

Hope someone here can help me out with this thanks Benedict

4
  • try testing with "132.230.166.21:8009" not localhost, since you didn't configure Apache for the same thing you are testing "successfully" Commented Feb 21, 2017 at 13:02
  • Hmm how would I go about that. When trying using the browser I get Connection Reset Commented Feb 21, 2017 at 13:10
  • So basically you have a networking issue when not connecting locally. Commented Feb 21, 2017 at 13:25
  • hmm I should point out that "132.230.166.21" is the same machine as localhost. Commented Feb 21, 2017 at 13:27

1 Answer 1

1

The Problem was with setting the SESSIONID after adding

ProxyPassReverseCookiePath /OntoRais / 

to the apache settings, all worked.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.