Forum Moderators: phranque

Message Too Old, No Replies

Apache2.2 Multipart request interception

         

EmilioSpring

11:10 am on Sep 9, 2011 (gmt 0)

10+ Year Member



Hi

Iīm having some extrange issue with Apache SSL 2.2 over Windows (OS doesnīt matter).

I want to monitorize the process of file upload form user pc to the server. Using Struts + Spring and WebLogic as Server, every thing works fine when you call the server directly.
But when the server is called throught apache proxy, the load of the file is done by the own proxy!.

The efect is the next:
- User selects a file an click upload
- Proxy inspect the request and starts the load of the file to a temp dir. If the file is big it could take several minutes.
- When proxy finish the temp upload, pass the request to the server
- Server parse the request, and starts the upload, but from the apacheīs temp dir to serverīs temp dir. Its always take a few seconds.
- The file is finally moved to final dir by the aplication.

So, how can you tell apache to not parse this request. In this way, would by de server who upload the file and I could monitorize this process.


Thanks in advance

phranque

5:57 am on Sep 12, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, EmilioSpring!

are you using mod_proxy?
you can use the ! directive to exclude reverse-proxy for a specified url path

EmilioSpring

6:32 am on Sep 12, 2011 (gmt 0)

10+ Year Member



Hi phranque

I donīt use mod_proxy. My conf is quite basic:
- Rewrite certain urls to served directly by the proxy static directory
- The other request are sent to weblogic

Here is an example:


<VirtualHost 10.8.6.5:8080>
ServerName 10.8.6.5:8080
ServerAlias 10.8.6.5:8080

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/(dog*|diario-oficial-galicia)
RewriteRule ^/(dog|diario-oficial-galicia|dogGestor|dogPublicador)/contenidoEstatico/(.*)$ http://localhost:8081/contenidoEstatico/$2 [P,L]

RewriteCond %{REQUEST_URI} ^/(dog*|diario-oficial-galicia)
RewriteRule ^/(dog|diario-oficial-galicia|dogGestor|dogPublicador)/Publicados/(.*)$ http://localhost:8081/Publicado/$2 [P,L]

<Location />
SetHandler weblogic-handler
WebLogicCluster wl-a-w.xunta.es:8016,wl-b-w.xunta.es:8016,wl-a-w.xunta.es:8017,wl-b-w.xunta.es:8017
</Location>

</VirtualHost>



I didnīt say, but the server is balanced (there are 4 nodes in cluster).

If I could exclude some requests, how could I redirect to the balancer?


thanks
regards

EmilioSpring

5:37 pm on Sep 21, 2011 (gmt 0)

10+ Year Member



Hi

I think I found the solution.
The key is FileCaching OFF. Acording to the doc, this is what it does:

When set to ON, and the size of the POST data in a request is greater than 2048 bytes, the POST data is first read into a temporary file on disk and then forwarded to the WebLogic Server in chunks of 8192 bytes. This preserves the POST data during failover, allowing all necessary data to be repeated to the secondary if the primary goes down.
Note that when FileCaching is ON, any client that tracks the progress of the POST will see that the transfer has completed even though the data is still being transferred between the WebServer and WebLogic. So, if you want the progress bar displayed by a browser during the upload to reflect when the data is actually available on the WebLogic Server, you might not want to have FileCaching ON.
When set to OFF and the size of the POST data in a request is greater than 2048 bytes, the reading of the POST data is postponed until a WebLogic Server cluster member is identified to serve the request. Then the Plugin reads and immediately sends the POST data to the WebLogic Server in chunks of 8192 bytes.
Note that turning FileCaching OFF limits failover. If the WebLogic Server primary server goes down while processing the request, the POST data already sent to the primary cannot be repeated to the secondary.
Finally, regardless of how FileCaching is set, if the size of the POST data is 2048 bytes or less the plugin will read the data into memory and use it if needed during failover to repeat to the secondary.


Thanks