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!

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.