Databases Reference
In-Depth Information
Listing 1-10. Restricting the application id in the Virtual Host
<VirtualHost *:80>
ServerName www.my-fantastic-application.com
ServerAlias www.my-fantastic-application.com
DocumentRoot /home/foo/www/
ProxyPreserveHost On
RewriteEngine On
#RewriteRule ^/$ /index.html [R=301,L]
RewriteRule ^/$ /pls/apex/f?p=FANTASTIC APPLICATION:HOME:0: [R=301,L]
RewriteCond %{REQUEST URI}%{QUERY STRING} /pls/apex/f?p=(.*)
RewriteCond %{REQUEST URI}%{QUERY STRING} !/pls/apex/f?p=(FANTASTIC APPLICATION:.*)
RewriteCond %{REQUEST URI}%{QUERY STRING} !/pls/apex/f?p=(1000:.*)
RewriteRule ^.* /pls/apex/f?p=FANTASTIC APPLICATION:HOME:0: [R=301]
</VirtualHost>
In this example, we use the RewriteCond directive to ensure that we are accessing the URL using an
application id of 1000 or the application alias FANTASTIC APPLICATION ; if not, then the URL will be
redirected back to the home page. There are an almost infinite number of possibilities available using
rewrite rules and conditions and you're really only limited by your imagination (or rather your practical
requirements!). Hopefully, these examples have shown you some of the possibilities to give your
production applications a more polished appearance to end users.
Prefork or Multi-Processing Module?
So far we have concentrated on configuring the OHS to access your APEX applications; now we are going
to look at a performance tweak that you can make to really increase the scalability of your APEX
environment.
Now, I want to say up front that I've talked about these techniques many times. I've presented them
at some of the major Oracle conferences such as Oracle OpenWorld, the ODTUG Kaleidoscope, the
UKOUG conference, the IOUG Collaborate conference, and the list goes on. I also covered some of these
techniques in my first topic, Pro Oracle Application Express . So, you might ask “Hey, don't you have any
new stuff to show us?”. Well, these techniques can have such an impact on the performance and
scalability of your applications that I won't stop talking about them until I've convinced every last one of
you that they're worth investigating!
The first tweak I want to mention is another change to the OHS configuration that can greatly
optimize the number of database pooled connections you see as a result of the mod plsql handler. My
good friend Joel Kallman, who is Director of Software at Oracle, wrote an excellent blog post on this
feature, which is available at
http://joelkallman.blogspot.com/2008/01/oracle-http-server-apache-20-and.html
Basically, this feature takes advantage of the true multi-threading capability in Apache 2.0, rather
than the previous prefork-based architecture in Apache 1.3. In other words, with the prefork-based
approach there was a single database connection per HTTP process, whereas with the multi-threaded
implementation (known as Multi-Processing Modules or MPM), there is a database connection pool
which is shared among all threads.
Search WWH ::




Custom Search