This discussion is archived
1 2 Previous Next 20 Replies Latest reply: Jan 9, 2008 6:33 AM by DietmarAust RSS

APEX charts and reverse proxy (Houston we have a problem!!)

3643 Newbie
Currently Being Moderated
Hi:

Every url html code generated by apex uses relative path, instead of absolute path. Every... i mean every except Charts :)
Apex charts puts absolute url on code [shame on this! :) ] ... look:

< param name="movie" value="/i/flashchart/2DPie.swf?XMLFile=http://195.32.2.3:8080/apex/apex_util.flash?p=100 ...

so Houston, we have a problem!

I am using Apache reverse proxy to access Apex, and as you may know, reverseproxy techniques are not html parsers, but only url handlers! So everytime i want to access a chart I have this pretty beautiful error inside the flash object:

XML loading failed: http://195.32.2.3:8080/apex/_blah_blah_blah :)

Anyone can help?


Best Regards,
Joao Oliveira
  • 1. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    Jes Oracle ACE
    Currently Being Moderated
    Hi Joao,

    Take a look at the following thread -

    APEX Charts - Error XML Loading falied

    John.
  • 2. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    3643 Newbie
    Currently Being Moderated
    Hi Jes,

    1st, Thanks for you answer. After reading it I am almost sure that this will work and solve the problem. but I have an answer...

    Where do I put this lines:

    PlsqlCGIEnvironmentList REQUEST_PROTOCOL=https
    PlsqlCGIEnvironmentList HTTP_HOST=external-name:external-port


    I can't find marvel.conf, neither dad.conf. I am using APEX without oracle http server installed, by using the database "gateway".

    Best Regards
    Joao Oliveira
  • 3. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    60660 Journeyer
    Currently Being Moderated
    After reading some of the solutions and documentation on apache2, I came up with this vhost configuration (still a bit of work-in-progress I'm afraid) under linux (APEX is set to its default port 8080):

    yourdomain.conf[b]
    <VirtualHost *:80>
    ServerName yourdomain
    SetEnv force-proxy-request-1.0 1 
    
    ProxyRequests           Off 
    ProxyHTMLExtended       Off 
    ProxyPreserveHost       On 
    
    ExtFilterDefine fixtext mode=output intype=text/html \ 
     cmd="/bin/sed s/:8080//g"  
    
    ProxyPass       /apex     http://localhost:8080/apex
    ProxyPass       /i        http://localhost:8080/i
    ProxyPass       /sys      http://localhost:8080/sys 
    
    <Location /apex>
             ProxyPassReverse http://localhost:8080/apex
             SetOutputFilter  fixtext
    </Location> 
    
    <Location /i>
             ProxyPassReverse http://localhost:8080/apex
             SetOutputFilter  fixtext
    </Location> 
    
    <Location /sys>
             ProxyPassReverse http://localhost:8080/apex
             SetOutputFilter  fixtext       
    </Location> 
    </VirtualHost>
    One problem with this solution is the ExtFilter, which could replace any 8080 occurrence in the returend website, but at least the graphs in the demo app are working again.

    C.
  • 4. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    Jes Oracle ACE
    Currently Being Moderated
    What an imaginative solution ;) -
    extFilterDefine fixtext mode=output intype=text/html \ 
      cmd="/bin/sed s/:8080//g" 
    But (and I haven't tested this yet), wouldn't that have a potential issue in that it could remove the string 8080 that was passed as part of a regular APEX url (since you're not just searching for the port), e.g. -
    http://apex.shellprompt.net/pls/apex/f?p=4550:1:8080042265718416
    In this case it would remove the 8080 in the session?

    To the OP, if you're using the Embedded PL/SQL gateway (I assume you're using XE or 11g, is that correct?), then you will need to look at the following document -

    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_epg.htm

    This shows you how you can make the equivalent setting for the DBMS_EPG.

    Hope this helps,

    John.
  • 5. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    60660 Journeyer
    Currently Being Moderated
    I don't think so, because the filter works on the returned document, not the URL. However, as I wrote, it could cause problems in replacing the 8080 value inside the document, for example in input/text fields.

    C.
  • 6. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    Jes Oracle ACE
    Currently Being Moderated
    Sorry, bad example (on my part), the session id is also in the HTML of the returned document so I think it would modify it there too (and cause havoc/mischief).

    John.
  • 7. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    60660 Journeyer
    Currently Being Moderated
    I haven't noticed that one yet, but if you say so, yes, there'll be a problem.

    [Update]: Didn't know how often the session id is used. Time to take a closer look on sed and a more appropriate regular expression.

    C.

    Message was edited by:
    cd
  • 8. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    3643 Newbie
    Currently Being Moderated
    Hi Jes,

    Thanks for your answer! Yes we are using 11G. I suppose that the default dad name is 'APEX'. I've been exploring the dbms_epg package but i could not use the function to return the current value (as security measure before update it)

    select dbms_epg.get_dad_attribute('APEX','cgi-environment-list')
    from dual

    This does not work...

    Neither this:
    select dbms_epg.get_dad_attribute('APEX','PlsqlCGIEnvironmentList')
    from dual

    Can you help on that?

    Joao
  • 9. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    3643 Newbie
    Currently Being Moderated
    can anyone help on this?
  • 10. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    3643 Newbie
    Currently Being Moderated
    Hi:

    Here it is what i tried:

    BEGIN
    DBMS_EPG.set_dad_attribute ('APEX',
    'PlsqlCGIEnvironmentList',
    'HTTP_HOST=www.myhost.pt:443'
    );
    END;

    And the errors:

    ORA-24232: o atributo do Gateway de PL/SQL Incorporado PlsqlCGIEnvironmentList é desconhecido
    ORA-06512: na "SYS.DBMS_SYS_ERROR", linha 86
    ORA-06512: na "SYS.DBMS_EPG", linha 101
    ORA-06512: na "SYS.DBMS_EPG", linha 265
    ORA-06512: na linha 2


    And the translation:
    ORA-24232: unknown Embedded PL/SQL Gateway attribute stringCause: The specified Embedded PL/SQL Gateway attribute was not known.

    Can anyone help?

    Best Regards,
    Joao
  • 11. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    3643 Newbie
    Currently Being Moderated
    Found it:

    BEGIN
    DBMS_EPG.set_dad_attribute ('APEX',
    'cgi-environment-list',
    'HTTP_HOST=www.myhost.pt:443'
    );
    END;

    The name of the parameter is different in the embebbed gateway

    Thanks
    Joao
  • 12. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    Jes Oracle ACE
    Currently Being Moderated
    Hi,

    If you look back at my previous message there's a link to the documentation that lists exactly which attribute you needed to use.

    John.


    ---------------------------------------------
    http://jes.blogs.shellprompt.net
  • 13. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    3643 Newbie
    Currently Being Moderated
    Hi Jes,

    I know, but i was trying to set the mod_plsql parameter... and the name of this parameter in the gateway is different from the one that we use to set in mod_plsql.

    Anyway, thanks for you help. It was really profitable!

    Joao
  • 14. Re: APEX charts and reverse proxy (Houston we have a problem!!)
    494966 Newbie
    Currently Being Moderated
    What an imaginative solution ;) -
    extFilterDefine fixtext mode=output intype=text/html
    \
    cmd="/bin/sed s/:8080//g" 
    pre]

    But (and I haven't tested this yet), wouldn't that
    have a potential issue in that it could remove the
    string 8080 that was passed as part of a regular APEX
    url (since you're not just searching for the port),
    e.g. -

    [pre]
    http://apex.shellprompt.net/pls/apex/f?p=4550:1:808
    0
    042265718416
    I know this one is rather old, but changing
    cmd="/bin/sed s/:8080//g"
    to
    cmd="/bin/sed s/:8080\//\//g"
    should do the trick.
    The expression searches for ":8080/" and replaces it with "/".

    hth,
    Moritz
1 2 Previous Next