You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Boysenberry Payne <bo...@humaniteque.com> on 2007/04/06 22:56:44 UTC

File Uploads using MP2 best practises

Currently, I'm using a 2 server setup.  Our "static" server (apache 1  
&& php) handles the initial
request and uses mod_rewrite to proxy to our "perl" server (apache2  
&& mod_perl2).
Our static server serves up files etc, except when MP is needed then  
it sends the request
to our perl server.
It works great for most stuff.

When it comes to uploading files I'm wondering if there isn't a  
better way than I'm doing it now.
Currently, I have file uploads proxy to the perl server, which then  
FTPs the file(s) to the static
server.  Not only does this tie up an otherwise fast MP child  
process, it does so for nearly twice
as long as it would if the file just ended up on the same server.

The obvious solution would seem to be setup the file upload code on  
the static server and skip
the perl server altogether.  The problem with this solution is  
authorization, etc happens on the perl
server (and with a rather complicated setup, the mysql server resides  
there too.)

Now I could go and write what I'd need on the static server (it has  
php installed as well as cgi,) but
doing that kind of defeats the elaborate system I've already  
developed and forces me to develop
using solutions other than MP to get file uploads working, not to  
mention the million other reasons
I'd prefer to stay with MP and avoid PHP, or CGI alternatives.

What I'm wondering is am I missing something obvious?
and...
How are other people handling this?  I can't imagine I'm the only  
person running into this...

Thanks in advance,
Boysenberry Payne
boysenberry@habitatlife.com




Re: File Uploads using MP2 best practises

Posted by Perrin Harkins <pe...@elem.com>.
On 4/6/07, Boysenberry Payne <bo...@humaniteque.com> wrote:
> The obvious solution would seem to be setup the file upload code on the
> static server and skip
> the perl server altogether.

Other obvious solutions would be to run both servers on the same
machine or use a networked filesystem like NFS.  A less obvious
solution would be to keep the images on your mod_perl machine and
proxy requests for them to a tiny static server on the mod_perl
machine that does nothing but serve them.

- Perrin