[xwiki-users] setting a fixed domain name?
Hello XWiki experts, I've been struggling with an XWiki bundled with jetty for which I can't set anything similar such as a VHost. Unfortunately, I cannot put a ProxyPassReverse (or ProxyPreserveHost) at the Apache level for lack of a plugin thus all redirects are expressed to localhost. My wiki is not intended to be used virtually. This used to be a non-problem since Tomcat had an adjustment to add this. Now that I am with Jetty, I am lost and it looks like neither XWiki nor Jetty does not have a setting to fix a domain name. Can it be? thanks in advance. Paul
I've been struggling with an XWiki bundled with jetty for which I can't set anything similar such as a VHost. Unfortunately, I cannot put a ProxyPassReverse (or ProxyPreserveHost) at the Apache level for lack of a plugin thus all redirects are expressed to localhost. My wiki is not intended to be used virtually.
Since i found no other contributions to this subject, I've written a small URLFactory which can be found here: https://github.com/polx/absolute-xwiki-urlfactory This factory also includes possibilities for content-distribution-networks such as Amazon CloudFront. Maybe xwiki.home was supposed to be used for that, but I couldn't get it to work (on xwiki-8.2): all my redirects ended up to localhost:8080. If there's a better way to share, feel free to indicate it. paul
Maybe you could also try using the URLRewriteFilter. It allows to do all sort of wild things on URLs (incoming and outgoing). See http://platform.xwiki.org/xwiki/bin/view/Main/ShortURLs#HUrlRewriteFilter Thanks -Vincent
On 06 Sep 2016, at 00:14, Paul Libbrecht <paul@hoplahup.net> wrote:
I've been struggling with an XWiki bundled with jetty for which I can't set anything similar such as a VHost. Unfortunately, I cannot put a ProxyPassReverse (or ProxyPreserveHost) at the Apache level for lack of a plugin thus all redirects are expressed to localhost. My wiki is not intended to be used virtually.
Since i found no other contributions to this subject, I've written a small URLFactory which can be found here: https://github.com/polx/absolute-xwiki-urlfactory This factory also includes possibilities for content-distribution-networks such as Amazon CloudFront.
Maybe xwiki.home was supposed to be used for that, but I couldn't get it to work (on xwiki-8.2): all my redirects ended up to localhost:8080. If there's a better way to share, feel free to indicate it.
paul
Vincent Massol wrote:
Maybe you could also try using the URLRewriteFilter. It allows to do all sort of wild things on URLs (incoming and outgoing).
See http://platform.xwiki.org/xwiki/bin/view/Main/ShortURLs#HUrlRewriteFilter That was my best hope and I looked into the documentation of URLRewriteFilter: http://www.tuckey.org/urlrewrite/ Unfortunately, there is nothing there about remapping redirects which is done by Apache's ProxyPassReverse and that was my big problem: after logging in or saving a page, my users got redirected to localhost:8080.
I assume everyone who has set-up an XWiki with an Apache on the front (quite an amount, right?) had ProxyPassReverse available somewhere... That was not my case hence my need. I'd be interested to hear, however, of people using a CDN together with XWiki which was the original purpose of this URLFactory that I recycled here. Paul
On 06 Sep 2016, at 09:07, Paul Libbrecht <paul@hoplahup.net> wrote:
Vincent Massol wrote:
Maybe you could also try using the URLRewriteFilter. It allows to do all sort of wild things on URLs (incoming and outgoing).
See http://platform.xwiki.org/xwiki/bin/view/Main/ShortURLs#HUrlRewriteFilter That was my best hope and I looked into the documentation of URLRewriteFilter: http://www.tuckey.org/urlrewrite/ Unfortunately, there is nothing there about remapping redirects which is done by Apache's ProxyPassReverse and that was my big problem: after logging in or saving a page, my users got redirected to localhost:8080.
What do you need to change? Some HTTP headers? I don’t know if you’ve noticed but you can also pass some Java class to URLRewriteFilter if you need something more complex than what is allowed from the XML configuration. Thanks -Vincent PS1: BTW I don’t think you need https://github.com/polx/absolute-xwiki-urlfactory/blob/master/src/main/java/... . You could simply use xwiki.urlfactory.servletclass PS2: I see that your URL factory factory only handles MODE_SERVLET. Is PDF export going to work fine in your case? (since it uses MODE_PDF).
I assume everyone who has set-up an XWiki with an Apache on the front (quite an amount, right?) had ProxyPassReverse available somewhere... That was not my case hence my need. I'd be interested to hear, however, of people using a CDN together with XWiki which was the original purpose of this URLFactory that I recycled here.
Paul
What do you need to change? Some HTTP headers? The Location header that are the core of the Redirects. From http://localhost:8080 to http://mydomain.net. I don't know if you've noticed but you can also pass some Java class to URLRewriteFilter if you need something more complex than what is allowed from the XML configuration. I haven't indeed. This is about a response header. This library is focussed on the request header as far as I could tell.
thanks for the hints. This is certainly simplifiable. Actually, shouldn't xwiki.home be used when sending redirects? paul
participants (2)
-
Paul Libbrecht -
Vincent Massol