sjarvela / kloudspeaker

Document management system
GNU General Public License v2.0
95 stars 40 forks source link

KloudServer through Apache ProxyPass not working #160

Open ks20160702 opened 8 years ago

ks20160702 commented 8 years ago

I have set-up an instance of Mollify and had it running on it's own server which was behind the main web server. On the main web server Apache had this setup to forward:

`<VirtualHost *:80> ServerName xxx.yyy.com.au ServerAlias xxx.yyy.com

ProxyPass / http://10.0.1.XXX/mollify/
ProxyPassReverse / http://10.0.1.XXX/mollify/

`

Upon realising that I had installed the old version I installed kloudspeaker in it's own directory with a new database. It works perfectly when on the local network accessing it directly (http://10.0.1.XXX/kloudspeaker/), however unlike mollify when I adjusted the main web server to point to kloudspeaker for the domain instead it doesn't work in Chrome or IE11, however it does work in IE10.

The new Apache config has this: `<VirtualHost *:80> ServerName xxx.yyy.com.au ServerAlias xxx.yyy.com

ProxyPass / http://10.0.1.XXX/kloudspeaker/
ProxyPassReverse / http://10.0.1.XXX/kloudspeaker/

`

I have tried setting the backend/configuration.php to have the hostname set, but that doesn't solve the issue.

"host_public_address" => "http://xxx.yyy.com.au",`

ks20160702 commented 8 years ago

A little deeper look at the access logs when a chrome session runs shows two 404 errors with the plugins:

203.2.94.XXX - - [20/Jul/2016:15:00:51 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36" 203.2.94.XXX - - [20/Jul/2016:15:00:52 +1000] "GET /templates/dialogs.html?_=1468990852021 HTTP/1.1" 200 4873 "http://xxx.yyy.com.au/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36" 203.2.94.XXX - - [20/Jul/2016:15:00:52 +1000] "GET /js/lib/ZeroClipboard.swf?nocache=1468990852057 HTTP/1.1" 200 1965 "http://xxx.yyy.com.au/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36" 203.2.94.XXX - - [20/Jul/2016:15:00:52 +1000] "GET /backend/r.php/session/info/ HTTP/1.1" 200 793 "http://xxx.yyy.com.au/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36" 203.2.94.XXX - - [20/Jul/2016:15:00:52 +1000] "GET /kloudspeaker/backend/plugin/FileViewerEditor/client//main.js HTTP/1.1" 404 271 "http://xxx.yyy.com.au/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36" 203.2.94.XXX - - [20/Jul/2016:15:00:52 +1000] "GET /kloudspeaker/backend/plugin/ItemDetails/client//main.js HTTP/1.1" 404 266 "http://xxx.yyy.com.au/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"

I'm suspecting this might have something to do with it. It seems to be adding a double back slash to the path before main.js.

ks20160702 commented 8 years ago

Seems like the issue was the request to the kloudspeaker directory which is already in the rewrite. To get around this you need to add another ProxyPass entry, like this:

` ServerName xxx.yyy.com.au ServerAlias xxx.yyy.com

ProxyPass /kloudspeaker http://10.0.1.XXX/kloudspeaker ProxyPassReverse /kloudspeaker http://10.0.1.XXX/kloudspeaker ProxyPass / http://10.0.1.XXX/kloudspeaker/ ProxyPassReverse / http://10.0.1.XXX/kloudspeaker/ `