[Building Sakai] Strange - proxyPort needed in serverl.xml to get request.getServerPort() to work

csev csev at umich.edu
Mon Mar 19 18:56:44 PDT 2012


I was re-testing IMS LTI Support in Sakai and came across a strange thing.   

My server was a fresh checkout, full compile, and a fresh Tomcat 7.0.21pulled from our maven repo.

Deep in some OAuth code it was doing a 

request.getRequestURL()
request.getServerPort()

The server was running on 8080 and yet, the port was 80 and the URL had no :8080 - the URL makes sense if it mistakenly thinks the port is 80.

I fussed around and then in a wild guess I made the following change to my server.xml:

    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               proxyPort="8080"
               redirectPort="8443" />

And it started working.   getServerPort() came back 8080 and the URL came back properly.   

Did some default change?  It almost seems like the proxyPort default used to be the same as port= - but is no longer the case.  I don't know when it broke...  Maybe I missed a memo...

I am not talking about production with a real proxy - I am talking about a dev environment running straight-up on 8080.

I am mostly curious and concerned to make sure our instructions are right here for a dev install on 8080..

Thanks.

/Chuck


More information about the sakai-dev mailing list