Watchlist email links use localhost instead of server hostname

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Watchlist email links use localhost instead of server hostname

Mario
The watchlist mail notifications we are receiving from our xwiki server have hyperlinks to the corresponding pages, but the link starts with "http://localhost/" as opposed to the actual server hostname.
How may we fix this?

Thank you
Mario
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname

Clemens Klein-Robbenhaar

If I remember correctly, XWiki uses the first incoming request to store the information by which hostname it is called, and uses this information in the background thread that sends the watchlist mails.

a) If you are sure that everyone accesses your wiki through the actual host name, you should be able to fix the problem by restarting the wiki
b) If that does not help: check if you have a proxy in front of XWiki; maybe that proxy does not pass through the "host" header from the browser
   (e.g apache httpd needs a "ProxyPreserveHost On" in its configuration to do so.)
c) Finally if you want to enfore the usage of a host name, and you can add something like

      wget --retry-connrefused --tries=100 --header 'Host: jabba.jabba.hey' http://localhost:8080/xwiki/bin/view/Main/

   to your start script to make sure XWiki uses a certain domain for the watchlist mails

HTH,
Clemens

On 09/22/2016 09:41 AM, Hofstätter Mario wrote:
> The watchlist mail notifications we are receiving from our xwiki server have hyperlinks to the corresponding pages, but the link starts with "http://localhost/" as opposed to the actual server hostname.
> How may we fix this?
>
> Thank you
> Mario

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname

Paul Libbrecht-2
And what if there was no request since the start but the watch list must fire?
To me relying on a first request is really dangerous, also there are cases where ProxyPreserveHost is not accessible (I had the case of having just mod_rewrite and no mod_proxy‎). 

A hard solution is to install a URL factory that is absolute (i've published one here, it has too many things but has worked for me), another is to change de tomcat config if available. 
Paul‎


-- fat fingered on my z10 --
  Message d'origine  
De: Clemens Klein-Robbenhaar
Envoyé: Freitag, 23. September 2016 16:15
À: XWiki Users
Répondre à: XWiki Users
Objet: Re: [xwiki-users] Watchlist email links use localhost instead of server hostname


If I remember correctly, XWiki uses the first incoming request to store the information by which hostname it is called, and uses this information in the background thread that sends the watchlist mails.

a) If you are sure that everyone accesses your wiki through the actual host name, you should be able to fix the problem by restarting the wiki
b) If that does not help: check if you have a proxy in front of XWiki; maybe that proxy does not pass through the "host" header from the browser
(e.g apache httpd needs a "ProxyPreserveHost On" in its configuration to do so.)
c) Finally if you want to enfore the usage of a host name, and you can add something like

wget --retry-connrefused --tries=100 --header 'Host: jabba.jabba.hey' http://localhost:8080/xwiki/bin/view/Main/

to your start script to make sure XWiki uses a certain domain for the watchlist mails

HTH,
Clemens

On 09/22/2016 09:41 AM, Hofstätter Mario wrote:
> The watchlist mail notifications we are receiving from our xwiki server have hyperlinks to the corresponding pages, but the link starts with "http://localhost/" as opposed to the actual server hostname.
> How may we fix this?
>
> Thank you
> Mario

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname

Thomas Mortagne
Administrator
On Fri, Sep 23, 2016 at 6:36 PM, Paul Libbrecht <[hidden email]> wrote:
> And what if there was no request since the start but the watch list must fire?

This is not possible since you need a request for the watchlist to be
initialized along with XWiki.

> To me relying on a first request is really dangerous, also there are cases where ProxyPreserveHost is not accessible (I had the case of having just mod_rewrite and no mod_proxy‎).
> ‎
> A hard solution is to install a URL factory that is absolute (i've published one here, it has too many things but has worked for me), another is to change de tomcat config if available.
> Paul‎
>
>
> -- fat fingered on my z10 --
>   Message d'origine
> De: Clemens Klein-Robbenhaar
> Envoyé: Freitag, 23. September 2016 16:15
> À: XWiki Users
> Répondre à: XWiki Users
> Objet: Re: [xwiki-users] Watchlist email links use localhost instead of server hostname
>
>
> If I remember correctly, XWiki uses the first incoming request to store the information by which hostname it is called, and uses this information in the background thread that sends the watchlist mails.
>
> a) If you are sure that everyone accesses your wiki through the actual host name, you should be able to fix the problem by restarting the wiki
> b) If that does not help: check if you have a proxy in front of XWiki; maybe that proxy does not pass through the "host" header from the browser
> (e.g apache httpd needs a "ProxyPreserveHost On" in its configuration to do so.)
> c) Finally if you want to enfore the usage of a host name, and you can add something like
>
> wget --retry-connrefused --tries=100 --header 'Host: jabba.jabba.hey' http://localhost:8080/xwiki/bin/view/Main/
>
> to your start script to make sure XWiki uses a certain domain for the watchlist mails
>
> HTH,
> Clemens
>
> On 09/22/2016 09:41 AM, Hofstätter Mario wrote:
>> The watchlist mail notifications we are receiving from our xwiki server have hyperlinks to the corresponding pages, but the link starts with "http://localhost/" as opposed to the actual server hostname.
>> How may we fix this?
>>
>> Thank you
>> Mario
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users



--
Thomas Mortagne
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname

Eduard Moraru
Hi,

Sounds to me like http://jira.xwiki.org/browse/XWIKI-13435

Thanks,
Eduard

On Fri, Sep 23, 2016 at 8:02 PM, Thomas Mortagne <[hidden email]>
wrote:

> On Fri, Sep 23, 2016 at 6:36 PM, Paul Libbrecht <[hidden email]> wrote:
> > And what if there was no request since the start but the watch list must
> fire?
>
> This is not possible since you need a request for the watchlist to be
> initialized along with XWiki.
>
> > To me relying on a first request is really dangerous, also there are
> cases where ProxyPreserveHost is not accessible (I had the case of having
> just mod_rewrite and no mod_proxy‎).
> > ‎
> > A hard solution is to install a URL factory that is absolute (i've
> published one here, it has too many things but has worked for me), another
> is to change de tomcat config if available.
> > Paul‎
> >
> >
> > -- fat fingered on my z10 --
> >   Message d'origine
> > De: Clemens Klein-Robbenhaar
> > Envoyé: Freitag, 23. September 2016 16:15
> > À: XWiki Users
> > Répondre à: XWiki Users
> > Objet: Re: [xwiki-users] Watchlist email links use localhost instead of
> server hostname
> >
> >
> > If I remember correctly, XWiki uses the first incoming request to store
> the information by which hostname it is called, and uses this information
> in the background thread that sends the watchlist mails.
> >
> > a) If you are sure that everyone accesses your wiki through the actual
> host name, you should be able to fix the problem by restarting the wiki
> > b) If that does not help: check if you have a proxy in front of XWiki;
> maybe that proxy does not pass through the "host" header from the browser
> > (e.g apache httpd needs a "ProxyPreserveHost On" in its configuration to
> do so.)
> > c) Finally if you want to enfore the usage of a host name, and you can
> add something like
> >
> > wget --retry-connrefused --tries=100 --header 'Host: jabba.jabba.hey'
> http://localhost:8080/xwiki/bin/view/Main/
> >
> > to your start script to make sure XWiki uses a certain domain for the
> watchlist mails
> >
> > HTH,
> > Clemens
> >
> > On 09/22/2016 09:41 AM, Hofstätter Mario wrote:
> >> The watchlist mail notifications we are receiving from our xwiki server
> have hyperlinks to the corresponding pages, but the link starts with "
> http://localhost/" as opposed to the actual server hostname.
> >> How may we fix this?
> >>
> >> Thank you
> >> Mario
> >
> > _______________________________________________
> > users mailing list
> > [hidden email]
> > http://lists.xwiki.org/mailman/listinfo/users
> > _______________________________________________
> > users mailing list
> > [hidden email]
> > http://lists.xwiki.org/mailman/listinfo/users
>
>
>
> --
> Thomas Mortagne
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname

vmassol
Administrator

> On 23 Sep 2016, at 21:00, Eduard Moraru <[hidden email]> wrote:
>
> Hi,
>
> Sounds to me like http://jira.xwiki.org/browse/XWIKI-13435

ah thanks, I spent at least 15 minutes trying to find this issue again and couldn’t! :)

-Vincent

> Thanks,
> Eduard
>
> On Fri, Sep 23, 2016 at 8:02 PM, Thomas Mortagne <[hidden email]>
> wrote:
>
>> On Fri, Sep 23, 2016 at 6:36 PM, Paul Libbrecht <[hidden email]> wrote:
>>> And what if there was no request since the start but the watch list must
>> fire?
>>
>> This is not possible since you need a request for the watchlist to be
>> initialized along with XWiki.
>>
>>> To me relying on a first request is really dangerous, also there are
>> cases where ProxyPreserveHost is not accessible (I had the case of having
>> just mod_rewrite and no mod_proxy‎).
>>> ‎
>>> A hard solution is to install a URL factory that is absolute (i've
>> published one here, it has too many things but has worked for me), another
>> is to change de tomcat config if available.
>>> Paul‎
>>>
>>>
>>> -- fat fingered on my z10 --
>>>  Message d'origine
>>> De: Clemens Klein-Robbenhaar
>>> Envoyé: Freitag, 23. September 2016 16:15
>>> À: XWiki Users
>>> Répondre à: XWiki Users
>>> Objet: Re: [xwiki-users] Watchlist email links use localhost instead of
>> server hostname
>>>
>>>
>>> If I remember correctly, XWiki uses the first incoming request to store
>> the information by which hostname it is called, and uses this information
>> in the background thread that sends the watchlist mails.
>>>
>>> a) If you are sure that everyone accesses your wiki through the actual
>> host name, you should be able to fix the problem by restarting the wiki
>>> b) If that does not help: check if you have a proxy in front of XWiki;
>> maybe that proxy does not pass through the "host" header from the browser
>>> (e.g apache httpd needs a "ProxyPreserveHost On" in its configuration to
>> do so.)
>>> c) Finally if you want to enfore the usage of a host name, and you can
>> add something like
>>>
>>> wget --retry-connrefused --tries=100 --header 'Host: jabba.jabba.hey'
>> http://localhost:8080/xwiki/bin/view/Main/
>>>
>>> to your start script to make sure XWiki uses a certain domain for the
>> watchlist mails
>>>
>>> HTH,
>>> Clemens
>>>
>>> On 09/22/2016 09:41 AM, Hofstätter Mario wrote:
>>>> The watchlist mail notifications we are receiving from our xwiki server
>> have hyperlinks to the corresponding pages, but the link starts with "
>> http://localhost/" as opposed to the actual server hostname.
>>>> How may we fix this?
>>>>
>>>> Thank you
>>>> Mario
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname

Eduard Moraru
On Fri, Sep 23, 2016 at 10:24 PM, Vincent Massol <[hidden email]> wrote:

>
> > On 23 Sep 2016, at 21:00, Eduard Moraru <[hidden email]> wrote:
> >
> > Hi,
> >
> > Sounds to me like http://jira.xwiki.org/browse/XWIKI-13435
>
> ah thanks, I spent at least 15 minutes trying to find this issue again and
> couldn’t! :)
>

Classic "cause" vs "manifestation" :)

-Eduard


>
> -Vincent
>
> > Thanks,
> > Eduard
> >
> > On Fri, Sep 23, 2016 at 8:02 PM, Thomas Mortagne <
> [hidden email]>
> > wrote:
> >
> >> On Fri, Sep 23, 2016 at 6:36 PM, Paul Libbrecht <[hidden email]>
> wrote:
> >>> And what if there was no request since the start but the watch list
> must
> >> fire?
> >>
> >> This is not possible since you need a request for the watchlist to be
> >> initialized along with XWiki.
> >>
> >>> To me relying on a first request is really dangerous, also there are
> >> cases where ProxyPreserveHost is not accessible (I had the case of
> having
> >> just mod_rewrite and no mod_proxy‎).
> >>> ‎
> >>> A hard solution is to install a URL factory that is absolute (i've
> >> published one here, it has too many things but has worked for me),
> another
> >> is to change de tomcat config if available.
> >>> Paul‎
> >>>
> >>>
> >>> -- fat fingered on my z10 --
> >>>  Message d'origine
> >>> De: Clemens Klein-Robbenhaar
> >>> Envoyé: Freitag, 23. September 2016 16:15
> >>> À: XWiki Users
> >>> Répondre à: XWiki Users
> >>> Objet: Re: [xwiki-users] Watchlist email links use localhost instead of
> >> server hostname
> >>>
> >>>
> >>> If I remember correctly, XWiki uses the first incoming request to store
> >> the information by which hostname it is called, and uses this
> information
> >> in the background thread that sends the watchlist mails.
> >>>
> >>> a) If you are sure that everyone accesses your wiki through the actual
> >> host name, you should be able to fix the problem by restarting the wiki
> >>> b) If that does not help: check if you have a proxy in front of XWiki;
> >> maybe that proxy does not pass through the "host" header from the
> browser
> >>> (e.g apache httpd needs a "ProxyPreserveHost On" in its configuration
> to
> >> do so.)
> >>> c) Finally if you want to enfore the usage of a host name, and you can
> >> add something like
> >>>
> >>> wget --retry-connrefused --tries=100 --header 'Host: jabba.jabba.hey'
> >> http://localhost:8080/xwiki/bin/view/Main/
> >>>
> >>> to your start script to make sure XWiki uses a certain domain for the
> >> watchlist mails
> >>>
> >>> HTH,
> >>> Clemens
> >>>
> >>> On 09/22/2016 09:41 AM, Hofstätter Mario wrote:
> >>>> The watchlist mail notifications we are receiving from our xwiki
> server
> >> have hyperlinks to the corresponding pages, but the link starts with "
> >> http://localhost/" as opposed to the actual server hostname.
> >>>> How may we fix this?
> >>>>
> >>>> Thank you
> >>>> Mario
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname

vmassol
Administrator

> On 23 Sep 2016, at 23:20, Eduard Moraru <[hidden email]> wrote:
>
> On Fri, Sep 23, 2016 at 10:24 PM, Vincent Massol <[hidden email]> wrote:
>
>>
>>> On 23 Sep 2016, at 21:00, Eduard Moraru <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> Sounds to me like http://jira.xwiki.org/browse/XWIKI-13435
>>
>> ah thanks, I spent at least 15 minutes trying to find this issue again and
>> couldn’t! :)
>>
>
> Classic "cause" vs "manifestation" :)

yup, I’ve added a comment to try to find it the next time… :)

Thanks
-Vincent

>
> -Eduard
>
>
>>
>> -Vincent
>>
>>> Thanks,
>>> Eduard
>>>
>>> On Fri, Sep 23, 2016 at 8:02 PM, Thomas Mortagne <
>> [hidden email]>
>>> wrote:
>>>
>>>> On Fri, Sep 23, 2016 at 6:36 PM, Paul Libbrecht <[hidden email]>
>> wrote:
>>>>> And what if there was no request since the start but the watch list
>> must
>>>> fire?
>>>>
>>>> This is not possible since you need a request for the watchlist to be
>>>> initialized along with XWiki.
>>>>
>>>>> To me relying on a first request is really dangerous, also there are
>>>> cases where ProxyPreserveHost is not accessible (I had the case of
>> having
>>>> just mod_rewrite and no mod_proxy‎).
>>>>> ‎
>>>>> A hard solution is to install a URL factory that is absolute (i've
>>>> published one here, it has too many things but has worked for me),
>> another
>>>> is to change de tomcat config if available.
>>>>> Paul‎
>>>>>
>>>>>
>>>>> -- fat fingered on my z10 --
>>>>> Message d'origine
>>>>> De: Clemens Klein-Robbenhaar
>>>>> Envoyé: Freitag, 23. September 2016 16:15
>>>>> À: XWiki Users
>>>>> Répondre à: XWiki Users
>>>>> Objet: Re: [xwiki-users] Watchlist email links use localhost instead of
>>>> server hostname
>>>>>
>>>>>
>>>>> If I remember correctly, XWiki uses the first incoming request to store
>>>> the information by which hostname it is called, and uses this
>> information
>>>> in the background thread that sends the watchlist mails.
>>>>>
>>>>> a) If you are sure that everyone accesses your wiki through the actual
>>>> host name, you should be able to fix the problem by restarting the wiki
>>>>> b) If that does not help: check if you have a proxy in front of XWiki;
>>>> maybe that proxy does not pass through the "host" header from the
>> browser
>>>>> (e.g apache httpd needs a "ProxyPreserveHost On" in its configuration
>> to
>>>> do so.)
>>>>> c) Finally if you want to enfore the usage of a host name, and you can
>>>> add something like
>>>>>
>>>>> wget --retry-connrefused --tries=100 --header 'Host: jabba.jabba.hey'
>>>> http://localhost:8080/xwiki/bin/view/Main/
>>>>>
>>>>> to your start script to make sure XWiki uses a certain domain for the
>>>> watchlist mails
>>>>>
>>>>> HTH,
>>>>> Clemens
>>>>>
>>>>> On 09/22/2016 09:41 AM, Hofstätter Mario wrote:
>>>>>> The watchlist mail notifications we are receiving from our xwiki
>> server
>>>> have hyperlinks to the corresponding pages, but the link starts with "
>>>> http://localhost/" as opposed to the actual server hostname.
>>>>>> How may we fix this?
>>>>>>
>>>>>> Thank you
>>>>>> Mario
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Watchlist email links use localhost instead of server hostname [SOLVED]

Mario
In reply to this post by Clemens Klein-Robbenhaar
Clemens Klein-Robbenhaar wrote
If I remember correctly, XWiki uses the first incoming request to store the information by which hostname it is called
It seems this was the issue. After a xwiki server restart the mails use the correct URL. I have probably logged in to xwiki on localhost after the last restart.

Thank you for your help.