Incorrect image source URL

Help
2012-10-16
2012-12-15
  • Hi, I am currently using Apache in front of Tomcat and I am proxy passing requests onto the tomcat like this.
    ProxyPass / https://my.local.server:8443/ProjectForge-force-SSL-4.1.3/
    Just about everything works, but some images seem to be hard coded with the context path (ProjectForge-force-SSL-4.1.3).
    For example, on the "New time sheet page" I see a img link like this:
    <img src="/ProjectForge-force-SSL-4.1.3/images/button_selectTask.png;jsessionid=……
    while other img tags uses relative URLs and so are displayed correctly such as
    <img src="../images/icons/small/white/cog_3.png" class="gear"/>

    This effect is the most visible on the "Select task" page, where every task name is prefixed with several missing images.

    Please help.

    Regards,
    Torbjørn

     
  • Kai Reinhard
    Kai Reinhard
    2012-10-16

    Hi,

    ProjectForge should work in any context. We run one ProjectForge instance with the following proxy-setting in server.xml:

    <Connector port="8085"
                    protocol="HTTP/1.1"
                    connectionTimeout="20000"
                    scheme="https"
                    proxyName="www.mydomain.com"  proxyPort="443"
                    />

    Then you should configure the domain in the config.xml (e. g. in $HOME/ProjectForge/config.xml):
    <?xml version="1.0" encoding="UTF-8" ?>
    <config>
      <domain>https://www.mydomain.com/projectforge</domain>;

    You have to play a little bit around with these settings. At the end, it should work ;-)
    There is also a config.xml property called servletContextPath, but the context path should be determined correctly by ProjectForge.
    <!- Uncomment this, if ProjectForge runs in root context: ->
      <!-servletContextPath></servletContextPath->

    Please let me know any of your findings.

    Best regards
    Kai

     
  • Hi Kai,

    Thanks a lot for the quick reply. I will start trying to create a new connector with a proxy name and then take it from there.
    I'm not sure I understand which config.xml file you are referring to. I do not have a $HOME/ProjectForge/config.xml.

    Seeing that you start by pointing out that ProjectForge should work in any context, I should probably clarify that ProjectForge is indeed working in the context ProjectForge-force-SSL-4.1.3. (This context was automatically created when I deployed the WAR through Tomcat manager).
    It is only a few images which are problematic. With a little luck, the problem will go away with the proper proxyName settings.

     
  • Kai Reinhard
    Kai Reinhard
    2012-10-17

    Hi,

    just for clarification: please use only the proxy-settings in  the Tomcat's server.xml mentioned above if you run Tomcat in such an environment. Yes, I mean the $HOME/ProjectForge/config.xml. Simply create this file:

    <?xml version="1.0" encoding="UTF-8" ?>
    <config>
      <domain>https://www.mydomain.com/projectforge</domain>
    </config>

    Good luck
    Kai