You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Tommy Pham <to...@gmail.com> on 2020/02/19 03:52:54 UTC

[Roller6] issue with Apache httpd 2.4 reverse proxy

Hello everyone,

For my new install of Roller 6 on Tomcat 9.0.30, I'm running into URL
issues with reverse proxy.  I have Apache httpd 2.4 to serve both static
and PHP based contents and Tomcat to serve Java based.  Both are running on
the same server at their default ports (httpd on 80 and 443 - Tomcat on
8080 and 8443).  I have the reverse proxy setup on httpd and it works OK
for some parts.

OK =>  http://f.q.d.n/blog/ => http://f.q.d.n:8080/blog/

However, the links are incorrect upon page load:

Home                              => http://f.q.d.n:8080/blog/Tommy
Categories - All               => http://f.q.d.n:8080/blog/Tommy/
Categories - Technology =>
http://f.q.d.n:8080/blog/Tommy/category/Technology
Categories - Finance      => http://f.q.d.n:8080/blog/Tommy/category/Finance
Categories - General      => http://f.q.d.n:8080/blog/Tommy/category/General
Subscribe to this blog     =>
http://f.q.d.n:8080/blog/Tommy/feed/entries/atom

The only links that are correct are:

Login         => http://f.q.d.n/blog/roller-ui/login-redirect.rol
New Entry =>
http://f.q.d.n/blog/roller-ui/authoring/entryAdd.rol?weblog=Tommy
Settings     =>
http://f.q.d.n/blog/roller-ui/authoring/weblogConfig.rol?weblog=Tommy
Logout       => http://f.q.d.n/blog/roller-ui/logout.rol

Also, when accessing HTTPS (I have it redirecting to Tomcat's HTTP on port
8080)

https://f.q.d.n/blog/

HTML loads OK but not displayed correctly because of these:

<!-- Bootstrap core CSS --><link rel="stylesheet"
href="http://f.q.d.n:8080/blog/Tommy/resource/css/bootstrap.css"
><link rel="stylesheet"
href="http://f.q.d.n:8080/blog/Tommy/resource/css/style.css" /><link
rel="stylesheet"
href="http://f.q.d.n:8080/blog/Tommy/resource/css/font-awesome.min.css"
/>


Does anyone have a similar setup and is experiencing similar issue?

Thanks,
Tommy

Re: [Roller6] issue with Apache httpd 2.4 reverse proxy

Posted by Tommy Pham <to...@gmail.com>.
After some debugging, I made the following changes to:

package org.apache.roller.weblogger.ui.rendering.model;

public class URLModel implements Model {

    public String getHome() {
//        return urlStrategy.getWeblogCollectionURL(weblog, locale, null,
null, null, -1, true);
        return urlStrategy.getWeblogCollectionURL(weblog, locale, null,
null, null, -1, false);
    }

    public String category(String catName) {
//        return urlStrategy.getWeblogCollectionURL(weblog, locale,
catName, null, null, -1, true);
        return urlStrategy.getWeblogCollectionURL(weblog, locale, catName,
null, null, -1, false);
    }

    public String category(String catName, int pageNum) {
//        return urlStrategy.getWeblogCollectionURL(weblog, locale,
catName, null, null, pageNum, true);
        return urlStrategy.getWeblogCollectionURL(weblog, locale, catName,
null, null, pageNum, false);
    }

    public String resource(String filePath) {
//        return urlStrategy.getWeblogResourceURL(weblog, filePath, true);
        return urlStrategy.getWeblogResourceURL(weblog, filePath, false);
    }
}

And the reported broken links work as expected.  I don't know if they have
any effects on planet/RSS yet since I don't have planet configured.

After reviewing other methods in that same class, I think I may need to
modify them to get them to work for tag(s), etc...


On Tue, Feb 18, 2020 at 7:56 PM Tommy Pham <to...@gmail.com> wrote:

> PS:  I forgot to add that the following also work as expected after logged
> in:
>
> Front Page
> Main Menu
>
> On Tue, Feb 18, 2020 at 7:52 PM Tommy Pham <to...@gmail.com> wrote:
>
>> Hello everyone,
>>
>> For my new install of Roller 6 on Tomcat 9.0.30, I'm running into URL
>> issues with reverse proxy.  I have Apache httpd 2.4 to serve both static
>> and PHP based contents and Tomcat to serve Java based.  Both are running on
>> the same server at their default ports (httpd on 80 and 443 - Tomcat on
>> 8080 and 8443).  I have the reverse proxy setup on httpd and it works OK
>> for some parts.
>>
>> OK =>  http://f.q.d.n/blog/ => http://f.q.d.n:8080/blog/
>>
>> However, the links are incorrect upon page load:
>>
>> Home                              => http://f.q.d.n:8080/blog/Tommy
>> Categories - All               => http://f.q.d.n:8080/blog/Tommy/
>> Categories - Technology =>
>> http://f.q.d.n:8080/blog/Tommy/category/Technology
>> Categories - Finance      =>
>> http://f.q.d.n:8080/blog/Tommy/category/Finance
>> Categories - General      =>
>> http://f.q.d.n:8080/blog/Tommy/category/General
>> Subscribe to this blog     =>
>> http://f.q.d.n:8080/blog/Tommy/feed/entries/atom
>>
>> The only links that are correct are:
>>
>> Login         => http://f.q.d.n/blog/roller-ui/login-redirect.rol
>> New Entry =>
>> http://f.q.d.n/blog/roller-ui/authoring/entryAdd.rol?weblog=Tommy
>> Settings     =>
>> http://f.q.d.n/blog/roller-ui/authoring/weblogConfig.rol?weblog=Tommy
>> Logout       => http://f.q.d.n/blog/roller-ui/logout.rol
>>
>> Also, when accessing HTTPS (I have it redirecting to Tomcat's HTTP on
>> port 8080)
>>
>> https://f.q.d.n/blog/
>>
>> HTML loads OK but not displayed correctly because of these:
>>
>> <!-- Bootstrap core CSS --><link rel="stylesheet" href="http://f.q.d.n:8080/blog/Tommy/resource/css/bootstrap.css" ><link rel="stylesheet" href="http://f.q.d.n:8080/blog/Tommy/resource/css/style.css" /><link rel="stylesheet" href="http://f.q.d.n:8080/blog/Tommy/resource/css/font-awesome.min.css" />
>>
>>
>> Does anyone have a similar setup and is experiencing similar issue?
>>
>> Thanks,
>> Tommy
>>
>

Re: [Roller6] issue with Apache httpd 2.4 reverse proxy

Posted by Tommy Pham <to...@gmail.com>.
PS:  I forgot to add that the following also work as expected after logged
in:

Front Page
Main Menu

On Tue, Feb 18, 2020 at 7:52 PM Tommy Pham <to...@gmail.com> wrote:

> Hello everyone,
>
> For my new install of Roller 6 on Tomcat 9.0.30, I'm running into URL
> issues with reverse proxy.  I have Apache httpd 2.4 to serve both static
> and PHP based contents and Tomcat to serve Java based.  Both are running on
> the same server at their default ports (httpd on 80 and 443 - Tomcat on
> 8080 and 8443).  I have the reverse proxy setup on httpd and it works OK
> for some parts.
>
> OK =>  http://f.q.d.n/blog/ => http://f.q.d.n:8080/blog/
>
> However, the links are incorrect upon page load:
>
> Home                              => http://f.q.d.n:8080/blog/Tommy
> Categories - All               => http://f.q.d.n:8080/blog/Tommy/
> Categories - Technology =>
> http://f.q.d.n:8080/blog/Tommy/category/Technology
> Categories - Finance      =>
> http://f.q.d.n:8080/blog/Tommy/category/Finance
> Categories - General      =>
> http://f.q.d.n:8080/blog/Tommy/category/General
> Subscribe to this blog     =>
> http://f.q.d.n:8080/blog/Tommy/feed/entries/atom
>
> The only links that are correct are:
>
> Login         => http://f.q.d.n/blog/roller-ui/login-redirect.rol
> New Entry =>
> http://f.q.d.n/blog/roller-ui/authoring/entryAdd.rol?weblog=Tommy
> Settings     =>
> http://f.q.d.n/blog/roller-ui/authoring/weblogConfig.rol?weblog=Tommy
> Logout       => http://f.q.d.n/blog/roller-ui/logout.rol
>
> Also, when accessing HTTPS (I have it redirecting to Tomcat's HTTP on port
> 8080)
>
> https://f.q.d.n/blog/
>
> HTML loads OK but not displayed correctly because of these:
>
> <!-- Bootstrap core CSS --><link rel="stylesheet" href="http://f.q.d.n:8080/blog/Tommy/resource/css/bootstrap.css" ><link rel="stylesheet" href="http://f.q.d.n:8080/blog/Tommy/resource/css/style.css" /><link rel="stylesheet" href="http://f.q.d.n:8080/blog/Tommy/resource/css/font-awesome.min.css" />
>
>
> Does anyone have a similar setup and is experiencing similar issue?
>
> Thanks,
> Tommy
>