I've moved...

This blog now has a new home - please update your shortcuts and readers to: www.jeffkemponoracle.com. Sorry for any inconvenience!

Tuesday, September 25, 2007

Dirt Cheap Oracle step #5(b) of 6: Making Apache and EPG Play Together

I want people to get to both my Apache web server (port 8000) as well as Apex (port 8080) via the default HTTP port (80) through the router, but you can't map one port to two ports - otherwise, how is the router to know which port to pass requests on to? There's a good reason why I've chosen the web server to get all the traffic, and that's because I have an idea how to get Apache to pass traffic to Apex, but not how the other way around could be done (EPG pass traffic to Apache).

[Full Article]

7 comments:

  1. Hi Jeff,

    Excellent write up, you're right about the problem of the non-caching images. I covered a bit about the problem of the standard APEX download procedures (which don't add Expire information) in a Whitepaper for the Collaborate 07 event (you can get the whitepaper here -

    http://jes.blogs.shellprompt.net/2007/05/18/apex-delivering-pages-in-3-seconds-or-less/

    I'm an advocate of writing your own upload/download routines, that way you can modify them to add the expiry headers).

    An alternative to this is to use the mod_expiry module in your Apache configuration to add the expiry information. If you need more details let me know.

    John.
    http://jes.blogs.shellprompt.net

    ReplyDelete
  2. Hi John,

    Thanks very much for your comment, I've read most of the whitepaper and it answered a lot of my questions. I'm looking forward to reading it again more thoroughly and trying some of the techniques.

    Jeff

    ReplyDelete
  3. Just another comment...

    If you find with this configuration that you can't view and edit PL/SQL code in Apex, you probably need to add these two lines to your httpd.conf:

    AddType text/xml xbl
    AddType text/x-component htc

    ReplyDelete
  4. Hi Jeff.

    Excellent for me too.

    Why don't you put also the line

    ProxyPass /i http://localhost:8080/i

    ?

    Alex

    ReplyDelete
  5. Hi Alexandre,

    Thanks for your comment. That's a very good question!

    /i/ is the alias for all the images that Apex needs (as well as for any application images I might import into the database). I would need to proxypass that as well, if I wished to serve the images from the database via EPG.

    However, since I'm running Apache web server, and I want to serve my images from the file system instead of from the database, I've configured Apache with an alias for /i/ that points to the apex images folder.

    The downside to this is that I can't use the normal image upload function in Apex (I have to save the image onto the filesystem). I guess I could use a different alias for these images, and perhaps sometime I will - in which case I would then have to use a proxypass directive like you suggest.

    Cheers

    Jeff

    ReplyDelete
  6. Hi Jeffrey,

    Just to be clear, you are using the follow lines in httdp.conf:
    ProxyRequests Off
    ProxyPass /apex http://localhost:8080/apex
    ProxyPassReverse / http://localhost:8080
    ProxyReceiveBufferSize 49152
    Alias /i/ "/usr/lib/oracle/apex/images/"

    Is that correct?
    I have made that but the images aren´t been cached... (I also copied the apex images folder to "/usr/lib/oracle/apex/images/"

    ReplyDelete
  7. Hi felipe,

    Those settings make the images faster to load (because they're being read from the filesystem by Apache rather than being extracted from the database), but they don't ensure they're cached on the client side.

    This follow up post explains this further. You need to add something like this:

    <LocationMatch /i>
    ExpiresActive on
    ExpiresDefault "access plus 1 month"
    </LocationMatch>

    This will tell clients that they may use a local copy of any files under the /i location if they were retrieved in the last month.

    ReplyDelete

Note: Only a member of this blog may post a comment.