Jump to content

Handling PHP Scripts with Multiple Servers?


genjitsu

Recommended Posts

Hi there - I'm not sure if this is the right forum for this question, but you'll see why:

 

I have an image gallery site that's been growing at a fairly steady pace. It relies primarily on a PHP script to process uploads. I'm thinking about adding a second server dedicated to hosting the images, and the database and scripts to be on the other. But what do I need to do to ensure seamless uploading? When a user submits a picture, I use move_uploaded_file() to move it to another directory, but how would I specify another server? Or is this something set on Apache itself, like mapping a directory on one server to the other?

 

Thanks for the help!

 

You use a "NFS" (network file share).

On linux this is simply:

apt-get install nfs-kernel-server

 

On the server you are uploading images to: run nfs-kernel-server and share out a directory via:

/etc/exports

 

On the server showing the photos etc. you can simply install by going:

apt-get install nfs-common

In /etc/fstab you can specify the shared directory and mount it.

 

Thats how Id do it.

 

-steve

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.